diff --git a/1.2.0-beta.1/javadoc/allclasses-frame.html b/1.2.0-beta.1/javadoc/allclasses-frame.html new file mode 100644 index 00000000..d82b63a7 --- /dev/null +++ b/1.2.0-beta.1/javadoc/allclasses-frame.html @@ -0,0 +1,72 @@ + + + +
+ +public static final class StructureEvent.StructureElementVisitedEvent +extends StructureEvent+
StructureEvent.StructureElementVisitedEventEvent.HasResult, Event.Result| Modifier and Type | +Method and Description | +
|---|---|
static void |
+fireEvent(World world,
+ int x,
+ int y,
+ int z,
+ int a,
+ int b,
+ int c,
+ IStructureElement<?> element)
+Fire this event on
+MinecraftForge.EVENT_BUS by populating it with given arguments. |
+
int |
+getA()
+A position in ABC coordinate, relative to (0,0,0) in the piece, i.e.
+ |
+
int |
+getB()
+B position in ABC coordinate, relative to (0,0,0) in the piece, i.e.
+ |
+
int |
+getC()
+C position in ABC coordinate, relative to (0,0,0) in the piece, i.e.
+ |
+
IStructureElement<?> |
+getElement()
+Element being visited.
+ |
+
World |
+getWorld()
+Location of this event.
+ |
+
int |
+getX()
+Location of this event.
+ |
+
int |
+getY()
+Location of this event.
+ |
+
int |
+getZ()
+Location of this event.
+ |
+
String |
+toString() |
+
getInstrumentIdentifiergetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setuppublic static void fireEvent(World world, + int x, + int y, + int z, + int a, + int b, + int c, + IStructureElement<?> element)+ +
public int getA()+
+ Submit a feature request if you need the baseOffset.
public int getB()+
+ Submit a feature request if you need the baseOffset.
public int getC()+
+ Submit a feature request if you need the baseOffset.
public IStructureElement<?> getElement()+
public World getWorld()+
public int getX()+
public int getY()+
public int getZ()+
public abstract class StructureEvent +extends Event+
+ All of these events will be fired on the MinecraftForge.EVENT_BUS, if they are
+ enabled by StructureLibAPI.enableInstrument(Object).
+
+ All public stuff in this class and its enclosed classes are considered part of the public API. + Backwards compatibility is maintained to the maximum extend possible.
| Modifier and Type | +Class and Description | +
|---|---|
static class |
+StructureEvent.StructureElementVisitedEvent
+Fired just before any structure element is visited.
+ |
+
Event.HasResult, Event.Result| Modifier and Type | +Method and Description | +
|---|---|
Object |
+getInstrumentIdentifier()
+The instrument identifier.
+ |
+
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setuppublic 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 |
+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 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.public class AlignmentUtility +extends Object+
| Modifier and Type | +Method and Description | +
|---|---|
static boolean |
+handle(EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ) |
+
public static boolean handle(EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ)+
public interface IAlignment +extends IAlignmentLimits, IAlignmentProvider+
IAlignmentLimits.Builder| Modifier and Type | +Field and Description | +
|---|---|
static int |
+DIRECTIONS_COUNT |
+
static int |
+FLIPS_COUNT |
+
static int |
+ROTATIONS_COUNT |
+
static int |
+STATES_COUNT |
+
UNLIMITED| Modifier and Type | +Method and Description | +
|---|---|
default boolean |
+canSetToDirectionAny(net.minecraftforge.common.util.ForgeDirection direction) |
+
default boolean |
+checkedSetDirection(net.minecraftforge.common.util.ForgeDirection direction) |
+
default boolean |
+checkedSetExtendedFacing(ExtendedFacing alignment) |
+
default boolean |
+checkedSetFlip(Flip flip) |
+
default boolean |
+checkedSetRotation(Rotation rotation) |
+
default IAlignment |
+getAlignment() |
+
static int |
+getAlignmentIndex(net.minecraftforge.common.util.ForgeDirection direction,
+ Rotation rotation,
+ Flip flip) |
+
IAlignmentLimits |
+getAlignmentLimits() |
+
default net.minecraftforge.common.util.ForgeDirection |
+getDirection() |
+
ExtendedFacing |
+getExtendedFacing() |
+
default Flip |
+getFlip() |
+
default Rotation |
+getRotation() |
+
default boolean |
+isExtendedFacingValid() |
+
default boolean |
+isNewDirectionValid(net.minecraftforge.common.util.ForgeDirection direction) |
+
default boolean |
+isNewExtendedFacingValid(ExtendedFacing alignment) |
+
default boolean |
+isNewExtendedFacingValid(net.minecraftforge.common.util.ForgeDirection direction,
+ Rotation rotation,
+ Flip flip) |
+
default boolean |
+isNewFlipValid(Flip flip) |
+
default boolean |
+isNewRotationValid(Rotation rotation) |
+
default void |
+setDirection(net.minecraftforge.common.util.ForgeDirection direction) |
+
void |
+setExtendedFacing(ExtendedFacing alignment)
+Set the facing without additional checks.
+ |
+
default void |
+setFlip(Flip flip) |
+
default void |
+setRotation(Rotation rotation) |
+
default boolean |
+toolSetDirection(net.minecraftforge.common.util.ForgeDirection direction) |
+
default boolean |
+toolSetExtendedFacing(ExtendedFacing extendedFacing) |
+
default boolean |
+toolSetFlip(Flip flip) |
+
default boolean |
+toolSetRotation(Rotation rotation) |
+
allowOnly, denyOnlystatic final int DIRECTIONS_COUNT+
static final int ROTATIONS_COUNT+
static final int FLIPS_COUNT+
static final int STATES_COUNT+
ExtendedFacing getExtendedFacing()+
void setExtendedFacing(ExtendedFacing alignment)+
toolSetExtendedFacing(ExtendedFacing) instead.IAlignmentLimits getAlignmentLimits()+
default IAlignment getAlignment()+
getAlignment in interface IAlignmentProviderstatic int getAlignmentIndex(net.minecraftforge.common.util.ForgeDirection direction, + Rotation rotation, + Flip flip)+
default net.minecraftforge.common.util.ForgeDirection getDirection()+
default void setDirection(net.minecraftforge.common.util.ForgeDirection direction)+
default Rotation getRotation()+
default void setRotation(Rotation rotation)+
default Flip getFlip()+
default void setFlip(Flip flip)+
default boolean toolSetDirection(net.minecraftforge.common.util.ForgeDirection direction)+
default boolean checkedSetDirection(net.minecraftforge.common.util.ForgeDirection direction)+
default boolean canSetToDirectionAny(net.minecraftforge.common.util.ForgeDirection direction)+
default boolean toolSetRotation(Rotation rotation)+
default boolean checkedSetRotation(Rotation rotation)+
default boolean toolSetFlip(Flip flip)+
default boolean checkedSetFlip(Flip flip)+
default boolean toolSetExtendedFacing(ExtendedFacing extendedFacing)+
default boolean checkedSetExtendedFacing(ExtendedFacing alignment)+
default boolean isNewDirectionValid(net.minecraftforge.common.util.ForgeDirection direction)+
default boolean isNewRotationValid(Rotation rotation)+
default boolean isNewFlipValid(Flip flip)+
default boolean isExtendedFacingValid()+
default boolean isNewExtendedFacingValid(net.minecraftforge.common.util.ForgeDirection direction, + Rotation rotation, + Flip flip)+
isNewExtendedFacingValid in interface IAlignmentLimitsdefault boolean isNewExtendedFacingValid(ExtendedFacing alignment)+
isNewExtendedFacingValid in interface IAlignmentLimitspublic static class IAlignmentLimits.Builder +extends Object+
| Modifier and Type | +Field and Description | +
|---|---|
protected boolean[] |
+validStates |
+
public static IAlignmentLimits.Builder allowAll()+
public static IAlignmentLimits.Builder denyAll()+
public IAlignmentLimits.Builder deny(net.minecraftforge.common.util.ForgeDirection fd)+
public IAlignmentLimits.Builder allow(net.minecraftforge.common.util.ForgeDirection fd)+
public IAlignmentLimits.Builder deny(ExtendedFacing o)+
public IAlignmentLimits.Builder allow(ExtendedFacing o)+
public IAlignmentLimits.Builder deny(Rotation fd)+
public IAlignmentLimits.Builder allow(Rotation fd)+
public IAlignmentLimits.Builder deny(Flip fd)+
public IAlignmentLimits.Builder allow(Flip fd)+
public IAlignmentLimits.Builder filter(Function<ExtendedFacing,Optional<Boolean>> predicate)+
public IAlignmentLimits.Builder ensureDuplicates()+
public IAlignmentLimits.Builder ensureNoDuplicates(Flip flip)+
flip - the preferred flip to be used Horizontal or verticalpublic IAlignmentLimits build()+
public interface IAlignmentLimits
+| Modifier and Type | +Interface and Description | +
|---|---|
static class |
+IAlignmentLimits.Builder |
+
| Modifier and Type | +Field and Description | +
|---|---|
static IAlignmentLimits |
+UNLIMITED |
+
| Modifier and Type | +Method and Description | +
|---|---|
static IAlignmentLimits |
+allowOnly(ExtendedFacing... allowedFacings) |
+
static IAlignmentLimits |
+denyOnly(ExtendedFacing... allowedFacings) |
+
default boolean |
+isNewExtendedFacingValid(ExtendedFacing alignment) |
+
boolean |
+isNewExtendedFacingValid(net.minecraftforge.common.util.ForgeDirection direction,
+ Rotation rotation,
+ Flip flip) |
+
static final IAlignmentLimits UNLIMITED+
boolean isNewExtendedFacingValid(net.minecraftforge.common.util.ForgeDirection direction, + Rotation rotation, + Flip flip)+
default boolean isNewExtendedFacingValid(ExtendedFacing alignment)+
static IAlignmentLimits allowOnly(ExtendedFacing... allowedFacings)+
static IAlignmentLimits denyOnly(ExtendedFacing... allowedFacings)+
public interface IAlignmentProvider
+| Modifier and Type | +Method and Description | +
|---|---|
IAlignment |
+getAlignment() |
+
@Nullable +IAlignment getAlignment()+
public class IntegerAxisSwap +extends Object+
| Constructor and Description | +
|---|
IntegerAxisSwap(net.minecraftforge.common.util.ForgeDirection forFirstAxis,
+ net.minecraftforge.common.util.ForgeDirection forSecondAxis,
+ net.minecraftforge.common.util.ForgeDirection forThirdAxis) |
+
| Modifier and Type | +Method and Description | +
|---|---|
void |
+inverseTranslate(double[] point,
+ double[] out) |
+
void |
+inverseTranslate(int[] point,
+ int[] out) |
+
Vec3 |
+inverseTranslate(Vec3 point) |
+
Vec3Impl |
+inverseTranslate(Vec3Impl point) |
+
void |
+translate(double[] point,
+ double[] out) |
+
void |
+translate(int[] point,
+ int[] out) |
+
Vec3 |
+translate(Vec3 point) |
+
Vec3Impl |
+translate(Vec3Impl point) |
+
public IntegerAxisSwap(net.minecraftforge.common.util.ForgeDirection forFirstAxis, + net.minecraftforge.common.util.ForgeDirection forSecondAxis, + net.minecraftforge.common.util.ForgeDirection forThirdAxis)+
public void translate(int[] point, + int[] out)+
public void inverseTranslate(int[] point, + int[] out)+
public void translate(double[] point, + double[] out)+
public void inverseTranslate(double[] point, + double[] out)+
public class ChannelDataAccessor +extends Object+
| Modifier and Type | +Method and Description | +
|---|---|
static int |
+countChannelData(ItemStack masterStack)
+Get the number of subchannels present on given trigger item.
+ |
+
static int |
+getChannelData(ItemStack masterStack,
+ String channel)
+Get the subchannel data from given trigger item.
+ |
+
static boolean |
+hasSubChannel(ItemStack masterStack)
+Check if given trigger item contains any subchannel
+ |
+
static boolean |
+hasSubChannel(ItemStack masterStack,
+ String channel)
+Check if given trigger item contains specified subchannel
+ |
+
static Stream<Map.Entry<String,Integer>> |
+iterateChannelData(ItemStack masterStack)
+Iterate over all subchannel data on trigger stack.
+ |
+
static void |
+setChannelData(ItemStack masterStack,
+ String channel,
+ int data)
+Set the subchannel data on given trigger item
+ |
+
static void |
+unsetChannelData(ItemStack masterStack,
+ String channel)
+Clear the given subchannel from given trigger item, if it exists
+ |
+
static void |
+wipeChannelData(ItemStack masterStack)
+Wipe all subchannel data on given trigger item
+ |
+
static ItemStack |
+withChannel(ItemStack masterStack,
+ String channel)
+Return a trigger item that
+
+ Still carry all the subchannel in some unspecified ways
+ Have its master channel data replaced with specified subchannel's data
+
+
+ If given subchannel does not exist, masterStack may or may not be returned to save performance.
+ |
+
public static ItemStack withChannel(ItemStack masterStack, + String channel)+
masterStack - trigger item. can be the return value of another withChannel(ItemStack, String) callchannel - subchannel to use. will use current master channel data instead if this channel does not exist
+ Note: all channel identifiers are supposed to be lower case and not empty.public static boolean hasSubChannel(ItemStack masterStack)+
masterStack - trigger stack to checkpublic static boolean hasSubChannel(ItemStack masterStack, + String channel)+
masterStack - trigger stack to checkchannel - channel identifier.
+ Note: all channel identifiers are supposed to be lower case and not empty.public static int getChannelData(ItemStack masterStack, + String channel)+
masterStack - trigger stack to query fromchannel - channel identifier.
+ Note: all channel identifiers are supposed to be lower case and not empty.public static void setChannelData(ItemStack masterStack, + String channel, + int data)+
masterStack - trigger stack to checkchannel - channel identifier.
+ Note: all channel identifiers are supposed to be lower case and not empty.data - subchannel data. should always be a positive valuepublic static void unsetChannelData(ItemStack masterStack, + String channel)+
masterStack - trigger stack to unsetchannel - channel identifier.
+ Note: all channel identifiers are supposed to be lower case and not empty.public static void wipeChannelData(ItemStack masterStack)+
masterStack - trigger stack to wipepublic static Stream<Map.Entry<String,Integer>> iterateChannelData(ItemStack masterStack)+
masterStack - trigger stack to checkConcurrentModificationException if underlying channel
+ data is modified while stream is working.public static int countChannelData(ItemStack masterStack)+
masterStack - trigger stack to query frompublic class ConstructableUtility +extends Object+
| Modifier and Type | +Method and Description | +
|---|---|
static boolean |
+handle(ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ int aSide) |
+
public static boolean handle(ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide)+
public interface IConstructable
+| Modifier and Type | +Method and Description | +
|---|---|
void |
+construct(ItemStack stackSize,
+ boolean hintsOnly) |
+
default IStructureDefinition<?> |
+getStructureDefinition()
+Get the structure definition used for this constructable.
+ |
+
String[] |
+getStructureDescription(ItemStack stackSize) |
+
void construct(ItemStack stackSize, + boolean hintsOnly)+
default IStructureDefinition<?> getStructureDefinition()+
public interface IConstructableProvider
+| Modifier and Type | +Method and Description | +
|---|---|
IConstructable |
+getConstructable() |
+
@Nullable +IConstructable getConstructable()+
public interface IMultiblockInfoContainer<T>
+| Modifier and Type | +Field and Description | +
|---|---|
static HashMap<String,IMultiblockInfoContainer<?>> |
+MULTIBLOCK_MAP |
+
| Modifier and Type | +Method and Description | +
|---|---|
void |
+construct(ItemStack stackSize,
+ boolean hintsOnly,
+ T tileEntity,
+ ExtendedFacing aSide) |
+
static boolean |
+contains(Class<?> tClass) |
+
static <T> IMultiblockInfoContainer<T> |
+get(Class<?> tClass) |
+
String[] |
+getDescription(ItemStack stackSize) |
+
static <T extends TileEntity> |
+registerTileClass(Class<T> clazz,
+ IMultiblockInfoContainer<?> info)
+There is no specific loading phase restriction, but you should generally not call it before the tile entity is
+ properly registered.
+ |
+
default int |
+survivalConstruct(ItemStack stackSize,
+ int elementBudge,
+ IItemSource source,
+ EntityPlayerMP actorProfile,
+ T tileEntity,
+ ExtendedFacing aSide)
+
+ |
+
static <T> ISurvivalConstructable |
+toConstructable(IMultiblockInfoContainer<T> thiz,
+ T tileEntity,
+ ExtendedFacing aSide) |
+
default IConstructable |
+toConstructable(T tileEntity,
+ ExtendedFacing aSide)
+Override this and return
+toConstructable(IMultiblockInfoContainer, Object, ExtendedFacing) if
+ survivalConstruct(ItemStack, int, IItemSource, EntityPlayerMP, Object, ExtendedFacing) isn't a stub |
+
static final HashMap<String,IMultiblockInfoContainer<?>> MULTIBLOCK_MAP+
static <T extends TileEntity> void registerTileClass(Class<T> clazz, + IMultiblockInfoContainer<?> info)+
static <T> IMultiblockInfoContainer<T> get(Class<?> tClass)+
static boolean contains(Class<?> tClass)+
void construct(ItemStack stackSize, + boolean hintsOnly, + T tileEntity, + ExtendedFacing aSide)+
default int survivalConstruct(ItemStack stackSize, + int elementBudge, + IItemSource source, + EntityPlayerMP actorProfile, + T tileEntity, + ExtendedFacing aSide)+
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, java.util.function.Consumer)default IConstructable toConstructable(T tileEntity, + ExtendedFacing aSide)+
toConstructable(IMultiblockInfoContainer, Object, ExtendedFacing) if
+ survivalConstruct(ItemStack, int, IItemSource, EntityPlayerMP, Object, ExtendedFacing) isn't a stubstatic <T> ISurvivalConstructable toConstructable(IMultiblockInfoContainer<T> thiz, + T tileEntity, + ExtendedFacing aSide)+
public interface ISurvivalConstructable +extends IConstructable+
IConstructable. Tile Entities (or delegates returned by IConstructableProvider.getConstructable()
+ should implement this interface to allow third party tools and StructureLib builtin constructable tools to trigger
+ autoplace in survival mode.
+
+ While not originally planned, a creative player can also use this interface to trigger autoplace by using an
+ IItemSource with every possible items in the game.
| Modifier and Type | +Field and Description | +
|---|---|
static boolean |
+DISABLE_HACKY_MIGRATION_CODE
+End player might want to disable this hack if it turns out to be too crashy
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
static EntityPlayer |
+__get_player()
+Deprecated.
+ |
+
default int |
+survivalConstruct(ItemStack stackSize,
+ int elementBudget,
+ IItemSource source,
+ EntityPlayerMP actor)
+Deprecated.
+ |
+
default int |
+survivalConstruct(ItemStack stackSize,
+ int elementBudget,
+ ISurvivalBuildEnvironment env)
+
+ |
+
construct, getStructureDefinition, getStructureDescriptionstatic final boolean DISABLE_HACKY_MIGRATION_CODE+
@Deprecated +default int survivalConstruct(ItemStack stackSize, + int elementBudget, + IItemSource source, + EntityPlayerMP actor)+
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, java.util.function.Consumer)
+ or IStructureDefinition.survivalBuild(Object, ItemStack, String, World, ExtendedFacing, int, int, int, int, int, int, int, IItemSource, EntityPlayerMP, boolean)elementBudget - The server configured element budget. The implementor can choose to tune this up a bit if
+ the structure is too big, but generally should not be a 4 digits number to not overwhelm the
+ serverdefault int survivalConstruct(ItemStack stackSize, + int elementBudget, + ISurvivalBuildEnvironment env)+
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment)
+ or IStructureDefinition.survivalBuild(Object, ItemStack, String, World, ExtendedFacing, int, int, int, int, int, int, int, ISurvivalBuildEnvironment, boolean)elementBudget - The server configured element budget. The implementor can choose to tune this up a bit if
+ the structure is too big, but generally should not be a 4 digits number to not overwhelm the
+ server@Deprecated +static EntityPlayer __get_player()+
See: Description
+| Interface | +Description | +
|---|---|
| IConstructable | +
+ Created by Tec on 24.03.2017.
+ |
+
| IConstructableProvider | +
+ Implement this interface if this tile entity MIGHT be constructable
+ |
+
| IMultiblockInfoContainer<T> | +
+ To implement IConstructable on not own TileEntities
+ |
+
| ISurvivalConstructable | +
+ An extension to
+IConstructable. |
+
| Class | +Description | +
|---|---|
| ChannelDataAccessor | +
+ Provide accessor methods for channel data from trigger item.
+ |
+
| ConstructableUtility | ++ |
public enum Direction +extends Enum<Direction>+
| Enum Constant and Description | +
|---|
DOWN |
+
EAST |
+
NORTH |
+
SOUTH |
+
UP |
+
WEST |
+
| Modifier and Type | +Field and Description | +
|---|---|
static Direction[] |
+VALUES |
+
| Modifier and Type | +Method and Description | +
|---|---|
Vec3Impl |
+getAxisVector() |
+
static Vec3Impl |
+getAxisVector(net.minecraftforge.common.util.ForgeDirection forgeDirection) |
+
static Direction |
+getByAxisVector(Vec3Impl vec3) |
+
net.minecraftforge.common.util.ForgeDirection |
+getForgeDirection() |
+
static Direction |
+valueOf(String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static Direction[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
public static final Direction DOWN+
public static final Direction UP+
public static final Direction NORTH+
public static final Direction SOUTH+
public static final Direction WEST+
public static final Direction EAST+
public static Direction[] values()+
+for (Direction c : Direction.values()) + System.out.println(c); +
public static Direction valueOf(String name)+
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic net.minecraftforge.common.util.ForgeDirection getForgeDirection()+
public Vec3Impl getAxisVector()+
public static Vec3Impl getAxisVector(net.minecraftforge.common.util.ForgeDirection forgeDirection)+
public enum ExtendedFacing +extends Enum<ExtendedFacing>+
| Modifier and Type | +Field and Description | +
|---|---|
static ExtendedFacing |
+DEFAULT |
+
static Map<net.minecraftforge.common.util.ForgeDirection,List<ExtendedFacing>> |
+FOR_FACING |
+
static int |
+STATES_COUNT |
+
static ExtendedFacing[] |
+VALUES |
+
| Modifier and Type | +Method and Description | +
|---|---|
static ExtendedFacing |
+byIndex(int index) |
+
static ExtendedFacing |
+byName(String name) |
+
static com.google.common.collect.ImmutableSet<ExtendedFacing> |
+getAllWith(Flip flip) |
+
static com.google.common.collect.ImmutableSet<ExtendedFacing> |
+getAllWith(net.minecraftforge.common.util.ForgeDirection direction) |
+
static com.google.common.collect.ImmutableSet<ExtendedFacing> |
+getAllWith(Rotation rotation) |
+
net.minecraftforge.common.util.ForgeDirection |
+getDirection() |
+
ExtendedFacing |
+getDuplicate()
+Gets the same effective facing achieved by different rot/flip combo
+ |
+
Flip |
+getFlip() |
+
int |
+getIndex() |
+
IntegerAxisSwap |
+getIntegerAxisSwap() |
+
String |
+getLocalizedName() |
+
String |
+getName2() |
+
void |
+getOffsetABC(double[] point,
+ double[] out) |
+
void |
+getOffsetABC(int[] point,
+ int[] out) |
+
Vec3 |
+getOffsetABC(Vec3 xyzOffset)
+Translates world offset to relative front facing offset
+ |
+
Vec3Impl |
+getOffsetABC(Vec3Impl xyzOffset) |
+
ExtendedFacing |
+getOppositeDirection() |
+
ExtendedFacing |
+getOppositeFlip() |
+
ExtendedFacing |
+getOppositeRotation() |
+
net.minecraftforge.common.util.ForgeDirection |
+getRelativeBackInWorld() |
+
net.minecraftforge.common.util.ForgeDirection |
+getRelativeDownInWorld() |
+
net.minecraftforge.common.util.ForgeDirection |
+getRelativeForwardInWorld() |
+
net.minecraftforge.common.util.ForgeDirection |
+getRelativeLeftInWorld() |
+
net.minecraftforge.common.util.ForgeDirection |
+getRelativeRightInWorld() |
+
net.minecraftforge.common.util.ForgeDirection |
+getRelativeUpInWorld() |
+
Rotation |
+getRotation() |
+
net.minecraftforge.common.util.ForgeDirection |
+getWorldDirection(net.minecraftforge.common.util.ForgeDirection abcDirection)
+do note the ABC coordinate system is (X, -Y, Z).
+ |
+
void |
+getWorldOffset(double[] point,
+ double[] out) |
+
void |
+getWorldOffset(int[] point,
+ int[] out) |
+
Vec3 |
+getWorldOffset(Vec3 abcOffset)
+Translates relative to front facing offset to world offset
+ |
+
Vec3Impl |
+getWorldOffset(Vec3Impl abcOffset) |
+
static ExtendedFacing |
+of(net.minecraftforge.common.util.ForgeDirection direction) |
+
static ExtendedFacing |
+of(net.minecraftforge.common.util.ForgeDirection direction,
+ Rotation rotation,
+ Flip flip) |
+
static ExtendedFacing |
+random(Random rand) |
+
static ExtendedFacing |
+valueOf(String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static ExtendedFacing[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
ExtendedFacing |
+with(Flip flip) |
+
ExtendedFacing |
+with(net.minecraftforge.common.util.ForgeDirection direction) |
+
ExtendedFacing |
+with(Rotation rotation) |
+
public static final ExtendedFacing DOWN_NORMAL_NONE+
public static final ExtendedFacing DOWN_NORMAL_HORIZONTAL+
public static final ExtendedFacing DOWN_NORMAL_VERTICAL+
public static final ExtendedFacing DOWN_NORMAL_BOTH+
public static final ExtendedFacing DOWN_CLOCKWISE_NONE+
public static final ExtendedFacing DOWN_CLOCKWISE_HORIZONTAL+
public static final ExtendedFacing DOWN_CLOCKWISE_VERTICAL+
public static final ExtendedFacing DOWN_CLOCKWISE_BOTH+
public static final ExtendedFacing DOWN_UPSIDE_DOWN_NONE+
public static final ExtendedFacing DOWN_UPSIDE_DOWN_HORIZONTAL+
public static final ExtendedFacing DOWN_UPSIDE_DOWN_VERTICAL+
public static final ExtendedFacing DOWN_UPSIDE_DOWN_BOTH+
public static final ExtendedFacing DOWN_COUNTER_CLOCKWISE_NONE+
public static final ExtendedFacing DOWN_COUNTER_CLOCKWISE_HORIZONTAL+
public static final ExtendedFacing DOWN_COUNTER_CLOCKWISE_VERTICAL+
public static final ExtendedFacing DOWN_COUNTER_CLOCKWISE_BOTH+
public static final ExtendedFacing UP_NORMAL_NONE+
public static final ExtendedFacing UP_NORMAL_HORIZONTAL+
public static final ExtendedFacing UP_NORMAL_VERTICAL+
public static final ExtendedFacing UP_NORMAL_BOTH+
public static final ExtendedFacing UP_CLOCKWISE_NONE+
public static final ExtendedFacing UP_CLOCKWISE_HORIZONTAL+
public static final ExtendedFacing UP_CLOCKWISE_VERTICAL+
public static final ExtendedFacing UP_CLOCKWISE_BOTH+
public static final ExtendedFacing UP_UPSIDE_DOWN_NONE+
public static final ExtendedFacing UP_UPSIDE_DOWN_HORIZONTAL+
public static final ExtendedFacing UP_UPSIDE_DOWN_VERTICAL+
public static final ExtendedFacing UP_UPSIDE_DOWN_BOTH+
public static final ExtendedFacing UP_COUNTER_CLOCKWISE_NONE+
public static final ExtendedFacing UP_COUNTER_CLOCKWISE_HORIZONTAL+
public static final ExtendedFacing UP_COUNTER_CLOCKWISE_VERTICAL+
public static final ExtendedFacing UP_COUNTER_CLOCKWISE_BOTH+
public static final ExtendedFacing NORTH_NORMAL_NONE+
public static final ExtendedFacing NORTH_NORMAL_HORIZONTAL+
public static final ExtendedFacing NORTH_NORMAL_VERTICAL+
public static final ExtendedFacing NORTH_NORMAL_BOTH+
public static final ExtendedFacing NORTH_CLOCKWISE_NONE+
public static final ExtendedFacing NORTH_CLOCKWISE_HORIZONTAL+
public static final ExtendedFacing NORTH_CLOCKWISE_VERTICAL+
public static final ExtendedFacing NORTH_CLOCKWISE_BOTH+
public static final ExtendedFacing NORTH_UPSIDE_DOWN_NONE+
public static final ExtendedFacing NORTH_UPSIDE_DOWN_HORIZONTAL+
public static final ExtendedFacing NORTH_UPSIDE_DOWN_VERTICAL+
public static final ExtendedFacing NORTH_UPSIDE_DOWN_BOTH+
public static final ExtendedFacing NORTH_COUNTER_CLOCKWISE_NONE+
public static final ExtendedFacing NORTH_COUNTER_CLOCKWISE_HORIZONTAL+
public static final ExtendedFacing NORTH_COUNTER_CLOCKWISE_VERTICAL+
public static final ExtendedFacing NORTH_COUNTER_CLOCKWISE_BOTH+
public static final ExtendedFacing SOUTH_NORMAL_NONE+
public static final ExtendedFacing SOUTH_NORMAL_HORIZONTAL+
public static final ExtendedFacing SOUTH_NORMAL_VERTICAL+
public static final ExtendedFacing SOUTH_NORMAL_BOTH+
public static final ExtendedFacing SOUTH_CLOCKWISE_NONE+
public static final ExtendedFacing SOUTH_CLOCKWISE_HORIZONTAL+
public static final ExtendedFacing SOUTH_CLOCKWISE_VERTICAL+
public static final ExtendedFacing SOUTH_CLOCKWISE_BOTH+
public static final ExtendedFacing SOUTH_UPSIDE_DOWN_NONE+
public static final ExtendedFacing SOUTH_UPSIDE_DOWN_HORIZONTAL+
public static final ExtendedFacing SOUTH_UPSIDE_DOWN_VERTICAL+
public static final ExtendedFacing SOUTH_UPSIDE_DOWN_BOTH+
public static final ExtendedFacing SOUTH_COUNTER_CLOCKWISE_NONE+
public static final ExtendedFacing SOUTH_COUNTER_CLOCKWISE_HORIZONTAL+
public static final ExtendedFacing SOUTH_COUNTER_CLOCKWISE_VERTICAL+
public static final ExtendedFacing SOUTH_COUNTER_CLOCKWISE_BOTH+
public static final ExtendedFacing WEST_NORMAL_NONE+
public static final ExtendedFacing WEST_NORMAL_HORIZONTAL+
public static final ExtendedFacing WEST_NORMAL_VERTICAL+
public static final ExtendedFacing WEST_NORMAL_BOTH+
public static final ExtendedFacing WEST_CLOCKWISE_NONE+
public static final ExtendedFacing WEST_CLOCKWISE_HORIZONTAL+
public static final ExtendedFacing WEST_CLOCKWISE_VERTICAL+
public static final ExtendedFacing WEST_CLOCKWISE_BOTH+
public static final ExtendedFacing WEST_UPSIDE_DOWN_NONE+
public static final ExtendedFacing WEST_UPSIDE_DOWN_HORIZONTAL+
public static final ExtendedFacing WEST_UPSIDE_DOWN_VERTICAL+
public static final ExtendedFacing WEST_UPSIDE_DOWN_BOTH+
public static final ExtendedFacing WEST_COUNTER_CLOCKWISE_NONE+
public static final ExtendedFacing WEST_COUNTER_CLOCKWISE_HORIZONTAL+
public static final ExtendedFacing WEST_COUNTER_CLOCKWISE_VERTICAL+
public static final ExtendedFacing WEST_COUNTER_CLOCKWISE_BOTH+
public static final ExtendedFacing EAST_NORMAL_NONE+
public static final ExtendedFacing EAST_NORMAL_HORIZONTAL+
public static final ExtendedFacing EAST_NORMAL_VERTICAL+
public static final ExtendedFacing EAST_NORMAL_BOTH+
public static final ExtendedFacing EAST_CLOCKWISE_NONE+
public static final ExtendedFacing EAST_CLOCKWISE_HORIZONTAL+
public static final ExtendedFacing EAST_CLOCKWISE_VERTICAL+
public static final ExtendedFacing EAST_CLOCKWISE_BOTH+
public static final ExtendedFacing EAST_UPSIDE_DOWN_NONE+
public static final ExtendedFacing EAST_UPSIDE_DOWN_HORIZONTAL+
public static final ExtendedFacing EAST_UPSIDE_DOWN_VERTICAL+
public static final ExtendedFacing EAST_UPSIDE_DOWN_BOTH+
public static final ExtendedFacing EAST_COUNTER_CLOCKWISE_NONE+
public static final ExtendedFacing EAST_COUNTER_CLOCKWISE_HORIZONTAL+
public static final ExtendedFacing EAST_COUNTER_CLOCKWISE_VERTICAL+
public static final ExtendedFacing EAST_COUNTER_CLOCKWISE_BOTH+
public static final ExtendedFacing DEFAULT+
public static final ExtendedFacing[] VALUES+
public static final Map<net.minecraftforge.common.util.ForgeDirection,List<ExtendedFacing>> FOR_FACING+
public static final int STATES_COUNT+
public static ExtendedFacing[] values()+
+for (ExtendedFacing c : ExtendedFacing.values()) + System.out.println(c); +
public static ExtendedFacing valueOf(String name)+
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static ExtendedFacing of(net.minecraftforge.common.util.ForgeDirection direction, + Rotation rotation, + Flip flip)+
public static ExtendedFacing of(net.minecraftforge.common.util.ForgeDirection direction)+
public static com.google.common.collect.ImmutableSet<ExtendedFacing> getAllWith(net.minecraftforge.common.util.ForgeDirection direction)+
public static com.google.common.collect.ImmutableSet<ExtendedFacing> getAllWith(Rotation rotation)+
public static com.google.common.collect.ImmutableSet<ExtendedFacing> getAllWith(Flip flip)+
public ExtendedFacing with(net.minecraftforge.common.util.ForgeDirection direction)+
public ExtendedFacing with(Rotation rotation)+
public ExtendedFacing with(Flip flip)+
public ExtendedFacing getOppositeDirection()+
public ExtendedFacing getOppositeRotation()+
public ExtendedFacing getOppositeFlip()+
public ExtendedFacing getDuplicate()+
public int getIndex()+
public String getName2()+
public String getLocalizedName()+
public static ExtendedFacing byName(String name)+
public static ExtendedFacing byIndex(int index)+
public static ExtendedFacing random(Random rand)+
public net.minecraftforge.common.util.ForgeDirection getDirection()+
public Rotation getRotation()+
public Flip getFlip()+
public Vec3 getWorldOffset(Vec3 abcOffset)+
abcOffset - A,B,C offset (facing relative L-->R,U-->D,F-->B)public void getWorldOffset(int[] point, + int[] out)+
public void getWorldOffset(double[] point, + double[] out)+
public net.minecraftforge.common.util.ForgeDirection getWorldDirection(net.minecraftforge.common.util.ForgeDirection abcDirection)+
public Vec3 getOffsetABC(Vec3 xyzOffset)+
xyzOffset - X,Y,Z offset in worldL-->R,U-->D,F-->B)public void getOffsetABC(int[] point, + int[] out)+
public void getOffsetABC(double[] point, + double[] out)+
public IntegerAxisSwap getIntegerAxisSwap()+
public net.minecraftforge.common.util.ForgeDirection getRelativeLeftInWorld()+
public net.minecraftforge.common.util.ForgeDirection getRelativeRightInWorld()+
public net.minecraftforge.common.util.ForgeDirection getRelativeDownInWorld()+
public net.minecraftforge.common.util.ForgeDirection getRelativeUpInWorld()+
public net.minecraftforge.common.util.ForgeDirection getRelativeBackInWorld()+
public net.minecraftforge.common.util.ForgeDirection getRelativeForwardInWorld()+
public enum Flip +extends Enum<Flip>+
| Enum Constant and Description | +
|---|
BOTH |
+
HORIZONTAL |
+
NONE |
+
VERTICAL |
+
| Modifier and Type | +Field and Description | +
|---|---|
static Flip[] |
+VALUES |
+
| Modifier and Type | +Method and Description | +
|---|---|
static Flip |
+byIndex(int index) |
+
static Flip |
+byName(String name) |
+
int |
+getIndex() |
+
String |
+getName() |
+
String |
+getName2() |
+
Flip |
+getOpposite() |
+
boolean |
+isBothFlipped() |
+
boolean |
+isHorizontallyFlipped() |
+
boolean |
+isNotFlipped() |
+
boolean |
+isVerticallyFliped() |
+
static Flip |
+random(Random rand) |
+
String |
+toString() |
+
static Flip |
+valueOf(String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static Flip[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
public static final Flip NONE+
public static final Flip HORIZONTAL+
public static final Flip VERTICAL+
public static final Flip BOTH+
public static Flip[] values()+
+for (Flip c : Flip.values()) + System.out.println(c); +
public static Flip valueOf(String name)+
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic int getIndex()+
public Flip getOpposite()+
public String getName2()+
public static Flip byIndex(int index)+
public String getName()+
public boolean isNotFlipped()+
public boolean isBothFlipped()+
public boolean isHorizontallyFlipped()+
public boolean isVerticallyFliped()+
public enum Rotation +extends Enum<Rotation>+
| Enum Constant and Description | +
|---|
CLOCKWISE |
+
COUNTER_CLOCKWISE |
+
NORMAL |
+
UPSIDE_DOWN |
+
| Modifier and Type | +Field and Description | +
|---|---|
static Rotation[] |
+VALUES |
+
| Modifier and Type | +Method and Description | +
|---|---|
static Rotation |
+byIndex(int index) |
+
static Rotation |
+byName(String name) |
+
int |
+getIndex() |
+
String |
+getName() |
+
String |
+getName2() |
+
Rotation |
+getOpposite() |
+
boolean |
+isClockwise() |
+
boolean |
+isCounterClockwise() |
+
boolean |
+isNotRotated() |
+
boolean |
+isUpsideDown() |
+
static Rotation |
+random(Random rand) |
+
String |
+toString() |
+
static Rotation |
+valueOf(String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static Rotation[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
public static final Rotation NORMAL+
public static final Rotation CLOCKWISE+
public static final Rotation UPSIDE_DOWN+
public static final Rotation COUNTER_CLOCKWISE+
public static Rotation[] values()+
+for (Rotation c : Rotation.values()) + System.out.println(c); +
public static Rotation valueOf(String name)+
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic int getIndex()+
public Rotation getOpposite()+
public String getName2()+
public static Rotation byIndex(int index)+
public String getName()+
public boolean isNotRotated()+
public boolean isClockwise()+
public boolean isCounterClockwise()+
public boolean isUpsideDown()+
| Enum | +Description | +
|---|---|
| Direction | ++ |
| ExtendedFacing | ++ |
| Flip | ++ |
| Rotation | ++ |
See: Description
+| Interface | +Description | +
|---|---|
| IAlignment | ++ |
| IAlignmentLimits | ++ |
| IAlignmentProvider | ++ |
| Class | +Description | +
|---|---|
| AlignmentUtility | ++ |
| IAlignmentLimits.Builder | ++ |
| IntegerAxisSwap | ++ |
+ All public stuff in this package and its subpackages are considered part of the public API. + Backwards compatibility is maintained to the maximum extend possible.
| Class | +Description | +
|---|---|
| StructureEvent | +
+ Subscribers are required to not keep reference to these events, nor to depend on values of these events after
+ the method call returns.
+ |
+
| StructureEvent.StructureElementVisitedEvent | +
+ Fired just before any structure element is visited.
+ |
+
| StructureLibAPI | +
+ A stable interface into the structure lib's internals.
+ |
+
public static enum AutoPlaceEnvironment.APILevel +extends Enum<AutoPlaceEnvironment.APILevel>+
AutoPlaceEnvironment has implemented.
+ + Enum constants are defined in chronological order.
| Enum Constant and Description | +
|---|
Legacy
+
+ |
+
LegacyRelaxed
+
+ |
+
V2
+Implements everything so far we have defined.
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
static AutoPlaceEnvironment.APILevel |
+valueOf(String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static AutoPlaceEnvironment.APILevel[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
public static final AutoPlaceEnvironment.APILevel Legacy+
AutoPlaceEnvironment.getChatter(), AutoPlaceEnvironment.getActor() and AutoPlaceEnvironment.getSource().
+ AutoPlaceEnvironment.getActor() is guaranteed to be an EntityPlayerMPpublic static final AutoPlaceEnvironment.APILevel LegacyRelaxed+
AutoPlaceEnvironment.getChatter(), AutoPlaceEnvironment.getActor() and AutoPlaceEnvironment.getSource().
+ AutoPlaceEnvironment.getActor() is NOT guaranteed to be an EntityPlayerMPpublic static final AutoPlaceEnvironment.APILevel V2+
public static AutoPlaceEnvironment.APILevel[] values()+
+for (AutoPlaceEnvironment.APILevel c : AutoPlaceEnvironment.APILevel.values()) + System.out.println(c); +
public static AutoPlaceEnvironment.APILevel valueOf(String name)+
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic class AutoPlaceEnvironment +extends Object+
| Modifier and Type | +Class and Description | +
|---|---|
static class |
+AutoPlaceEnvironment.APILevel
+Defines the various API level an
+AutoPlaceEnvironment has implemented. |
+
| Modifier | +Constructor and Description | +
|---|---|
protected |
+AutoPlaceEnvironment(AutoPlaceEnvironment parent) |
+
| Modifier and Type | +Method and Description | +
|---|---|
static AutoPlaceEnvironment |
+fromLegacy(IItemSource source,
+ EntityPlayer actor,
+ Consumer<IChatComponent> chatter) |
+
EntityPlayer |
+getActor()
+The initiator of actions.
+ |
+
AutoPlaceEnvironment.APILevel |
+getAPILevel() |
+
Consumer<IChatComponent> |
+getChatter()
+send error messages here.
+ |
+
ExtendedFacing |
+getFacing() |
+
IItemSource |
+getSource()
+From where survival autoplace will drain resources.
+ |
+
boolean |
+isContainedInPiece(int offsetA,
+ int offsetB,
+ int offsetC)
+Test if given location is contained within the current piece.
+ |
+
AutoPlaceEnvironment |
+withActor(EntityPlayer actor)
+Return a new instance with actor modified to given value.
+ |
+
AutoPlaceEnvironment |
+withChatter(Consumer<IChatComponent> chatter)
+Return a new instance with chatter modified to given value.
+ |
+
AutoPlaceEnvironment |
+withSource(IItemSource source)
+Return a new instance with source modified to given value.
+ |
+
protected AutoPlaceEnvironment(AutoPlaceEnvironment parent)+
public static AutoPlaceEnvironment fromLegacy(IItemSource source, + EntityPlayer actor, + Consumer<IChatComponent> chatter)+
public AutoPlaceEnvironment.APILevel getAPILevel()+
public IItemSource getSource()+
public EntityPlayer getActor()+
getChatter() might have. You might want to use
+ StructureLibAPI.addThrottledChat(Object, EntityPlayer, IChatComponent, short)
+ to help reduce spam.public Consumer<IChatComponent> getChatter()+
public boolean isContainedInPiece(int offsetA, + int offsetB, + int offsetC)+
offsetA - offset in A direction relative to current elementoffsetB - offset in B direction relative to current elementoffsetC - offset in C direction relative to current elementpublic ExtendedFacing getFacing()+
public AutoPlaceEnvironment withSource(IItemSource source)+
source - new sourcepublic AutoPlaceEnvironment withActor(EntityPlayer actor)+
actor - new actorpublic AutoPlaceEnvironment withChatter(Consumer<IChatComponent> chatter)+
chatter - new chatterpublic interface IBlockPosConsumer
+| Modifier and Type | +Method and Description | +
|---|---|
void |
+consume(World world,
+ int x,
+ int y,
+ int z) |
+
public interface ICustomBlockSetting
+| Modifier and Type | +Method and Description | +
|---|---|
void |
+setBlock(World world,
+ int x,
+ int y,
+ int z,
+ int meta)
+Default block setting calls
+World.setBlock(int x, int y, int z, Block block, int meta, int updateType) like:
+ world.setBlock(x,y,z,this/block,meta,2) where updateType 2 means to update lighting and stuff |
+
void setBlock(World world, + int x, + int y, + int z, + int meta)+
World.setBlock(int x, int y, int z, Block block, int meta, int updateType) like:
+ world.setBlock(x,y,z,this/block,meta,2) where updateType 2 means to update lighting and stuffworld - world that should be affectedx - x position to sety - y position to setz - z position to setmeta - required metapublic interface IItemSource
+| Modifier and Type | +Method and Description | +
|---|---|
static IItemSource |
+fromInventory(IInventory inv)
+Construct an IItemSource from given inventory
+ |
+
static IItemSource |
+fromPlayer(EntityPlayerMP player)
+Construct an IItemSource from inventories associated with given player.
+ |
+
Map<ItemStack,Integer> |
+take(Predicate<ItemStack> predicate,
+ boolean simulate,
+ int count)
+Retrieve some amount of items from this item source matching given filter.
+ |
+
default boolean |
+takeAll(ItemStack stack,
+ boolean simulate)
+Take some item.
+ |
+
default boolean |
+takeAll(Predicate<ItemStack> predicate,
+ boolean simulate,
+ int count)
+Take exactly count amount of items matching predicate.
+ |
+
default boolean |
+takeOne(ItemStack stack,
+ boolean simulate)
+Take exactly one item.
+ |
+
default ItemStack |
+takeOne(Predicate<ItemStack> predicate,
+ boolean simulate)
+Take exactly one item that matches the predicate.
+ |
+
@Nonnull +Map<ItemStack,Integer> take(Predicate<ItemStack> predicate, + boolean simulate, + int count)+
+ We probably don't need to get a lot of items from this method, + so I don't care about the overhead of storing all fetched items even if downstream code doesn't need it
predicate - filtering predicate. should return true for ItemStacks that should be added to result collectionsimulate - whether to actually commit the modification. true for dry run, false otherwise.count - how many items to extract.default ItemStack takeOne(Predicate<ItemStack> predicate, + boolean simulate)+
predicate - filtering predicate. should return true for ItemStacks that should be added to result collectionsimulate - whether to actually commit the modification. true for dry run, false otherwise.IllegalArgumentException - if given predicate is null.default boolean takeAll(Predicate<ItemStack> predicate, + boolean simulate, + int count)+
predicate - filtering predicate. should return true for ItemStacks that should be added to result collectionsimulate - whether to actually commit the modification. true for dry run, false otherwise.count - how many items to extract.IllegalArgumentException - if given predicate is nulldefault boolean takeOne(ItemStack stack, + boolean simulate)+
+ This is meant to be an optimized version of takeOne(Predicate, boolean).
+ Implementations that support item storage indexed by ItemStack can use this to speed up calculation.
stack - what item to extract. The NBT tag of this ItemStack is siginifcant and will be
+ considered during matching. must have a stack size of 1.simulate - whether to actually commit the modification. true for dry run, false otherwise.IllegalArgumentException - if given stack is invalid, or has a stack size other than 1.default boolean takeAll(ItemStack stack, + boolean simulate)+
+ This is meant to be an optimized version of takeOne(Predicate, boolean).
+ Implementations that support indexing off ItemStack can use this to speed up calculation.
stack - what item and how many to extract. The NBT tag of this ItemStack is siginifcant and will be
+ considered during matchingsimulate - whether to actually commit the modification. true for dry run, false otherwise.IllegalArgumentException - if given stack is invalidstatic IItemSource fromPlayer(EntityPlayerMP player)+
+ This will be backed by InventoryUtility
static IItemSource fromInventory(IInventory inv)+
+ This will be backed by InventoryUtility
public interface ISpecialItemBlock
+| Modifier and Type | +Method and Description | +
|---|---|
int |
+getItemMetaFromBlockMeta(Block block,
+ int blockMeta) |
+
T - Type of the context object. Usually this will be the multiblock controller.public interface IStructureDefinition<T>
+
+ You will construct this definition once per multi, either at class load or at first call to your variant of getStructureDefinition().
+ You can use a ClassValue<IStructureDefinition<?>> if you have a template for subclass.
+ You can also use defer() or its overloads for simpler cases, but it is
+ slightly less performant as it will allocate new objects on each structure check, whereas ClassValue will
+ allocate once and cache it onwards.
+
+
+ IStructureDefinition is constructed using builder()
+
+ Builder has two main methods: +
addShape()
+ is a 2d string array describing the layout of structure. You can optionally use `StructureUtility#transpose()`
+ to transpose the array to make the structure look nicer in source code.
+ addElement(). It takes a char identifier (mapped to a char in any of addShape() calls) and a IStructureElement.
+ | Modifier and Type | +Method and Description | +
|---|---|
default boolean |
+build(T object,
+ ItemStack trigger,
+ String piece,
+ World world,
+ ExtendedFacing extendedFacing,
+ int basePositionX,
+ int basePositionY,
+ int basePositionZ,
+ int basePositionA,
+ int basePositionB,
+ int basePositionC)
+Build the multi in creative mode on a best-effort basis.
+ |
+
static <T> StructureDefinition.Builder<T> |
+builder()
+Create a new instance of builder.
+ |
+
default boolean |
+buildOrHints(T object,
+ ItemStack trigger,
+ String piece,
+ World world,
+ ExtendedFacing extendedFacing,
+ int basePositionX,
+ int basePositionY,
+ int basePositionZ,
+ int basePositionA,
+ int basePositionB,
+ int basePositionC,
+ boolean hintsOnly)
+
+ |
+
default boolean |
+check(T object,
+ String piece,
+ World world,
+ ExtendedFacing extendedFacing,
+ int basePositionX,
+ int basePositionY,
+ int basePositionZ,
+ int basePositionA,
+ int basePositionB,
+ int basePositionC,
+ boolean forceCheckAllBlocks)
+Run a structure check.
+ |
+
IStructureElement<T>[] |
+getStructureFor(String name)
+Used internally
+ |
+
default boolean |
+hints(T object,
+ ItemStack trigger,
+ String piece,
+ World world,
+ ExtendedFacing extendedFacing,
+ int basePositionX,
+ int basePositionY,
+ int basePositionZ,
+ int basePositionA,
+ int basePositionB,
+ int basePositionC)
+Spawn hint particles.
+ |
+
boolean |
+isContainedInStructure(String name,
+ int offsetA,
+ int offsetB,
+ int offsetC) |
+
static <T> boolean |
+iterate(T object,
+ ItemStack trigger,
+ IStructureElement<T>[] elements,
+ World world,
+ ExtendedFacing extendedFacing,
+ int basePositionX,
+ int basePositionY,
+ int basePositionZ,
+ int basePositionA,
+ int basePositionB,
+ int basePositionC,
+ boolean hintsOnly,
+ Boolean checkBlocksIfNotNullForceCheckAllIfTrue)
+Low level utility.
+ |
+
default int |
+survivalBuild(T object,
+ ItemStack trigger,
+ String piece,
+ World world,
+ ExtendedFacing extendedFacing,
+ int basePositionX,
+ int basePositionY,
+ int basePositionZ,
+ int basePositionA,
+ int basePositionB,
+ int basePositionC,
+ int elementBudget,
+ IItemSource source,
+ EntityPlayerMP actor,
+ boolean check)
+Deprecated.
+ |
+
default int |
+survivalBuild(T object,
+ ItemStack trigger,
+ String piece,
+ World world,
+ ExtendedFacing extendedFacing,
+ int basePositionX,
+ int basePositionY,
+ int basePositionZ,
+ int basePositionA,
+ int basePositionB,
+ int basePositionC,
+ int elementBudget,
+ ISurvivalBuildEnvironment env,
+ boolean check)
+Cause a survival build.
+ |
+
IStructureElement<T>[] getStructureFor(String name)+
+ Might, but is not required, to throw NoSuchElementException if the given structure piece is not found.
name - same name as for other methods hereNoSuchElementException - if the given structure piece is not found and the moon phase perfectly matchesboolean isContainedInStructure(String name, + int offsetA, + int offsetB, + int offsetC)+
default boolean check(T object, + String piece, + World world, + ExtendedFacing extendedFacing, + int basePositionX, + int basePositionY, + int basePositionZ, + int basePositionA, + int basePositionB, + int basePositionC, + boolean forceCheckAllBlocks)+
object - context object. usually multiblock controller.piece - the structure piece's string identifier.world - the world object this check takes place in.extendedFacing - the current structure's orientation.basePositionX - X location of the structurebasePositionY - Y location of the structurebasePositionZ - Z location of the structurebasePositionA - see class javadocbasePositionB - see class javadocbasePositionC - see class javadocforceCheckAllBlocks - check all location even if chunk not currently loaded.default boolean hints(T object, + ItemStack trigger, + String piece, + World world, + ExtendedFacing extendedFacing, + int basePositionX, + int basePositionY, + int basePositionZ, + int basePositionA, + int basePositionB, + int basePositionC)+
object - context object. usually multiblock controller.piece - the structure piece's string identifier.world - the world object this check takes place in.extendedFacing - the current structure's orientation.basePositionX - X location of the structurebasePositionY - Y location of the structurebasePositionZ - Z location of the structurebasePositionA - see class javadocbasePositionB - see class javadocbasePositionC - see class javadocdefault boolean build(T object, + ItemStack trigger, + String piece, + World world, + ExtendedFacing extendedFacing, + int basePositionX, + int basePositionY, + int basePositionZ, + int basePositionA, + int basePositionB, + int basePositionC)+
object - context object. usually multiblock controller.trigger - The trigger item that contains channel data.piece - the structure piece's string identifier.world - the world object this check takes place in.extendedFacing - the current structure's orientation.basePositionX - X location of the structurebasePositionY - Y location of the structurebasePositionZ - Z location of the structurebasePositionA - see class javadocbasePositionB - see class javadocbasePositionC - see class javadocdefault boolean buildOrHints(T object, + ItemStack trigger, + String piece, + World world, + ExtendedFacing extendedFacing, + int basePositionX, + int basePositionY, + int basePositionZ, + int basePositionA, + int basePositionB, + int basePositionC, + boolean hintsOnly)+
build(Object, ItemStack, String, World, ExtendedFacing, int, int, int, int, int, int) if hintsOnly,
+ call hints(Object, ItemStack, String, World, ExtendedFacing, int, int, int, int, int, int) otherwise.object - context object. usually multiblock controller.trigger - The trigger item that contains channel data.piece - the structure piece's string identifier.world - the world object this check takes place in.extendedFacing - the current structure's orientation.basePositionX - X location of the structurebasePositionY - Y location of the structurebasePositionZ - Z location of the structurebasePositionA - see class javadocbasePositionB - see class javadocbasePositionC - see class javadochintsOnly - whether to spawn hints or do creative build.hints(Object, ItemStack, String, World, ExtendedFacing, int, int, int, int, int, int),
+build(Object, ItemStack, String, World, ExtendedFacing, int, int, int, int, int, int)@Deprecated +default int survivalBuild(T object, + ItemStack trigger, + String piece, + World world, + ExtendedFacing extendedFacing, + int basePositionX, + int basePositionY, + int basePositionZ, + int basePositionA, + int basePositionB, + int basePositionC, + int elementBudget, + IItemSource source, + EntityPlayerMP actor, + boolean check)+
object - context object. usually multiblock controller.trigger - The trigger item that contains channel data.piece - the structure piece's string identifier.world - the world object this check takes place in.extendedFacing - the current structure's orientation.basePositionX - X location of the structurebasePositionY - Y location of the structurebasePositionZ - Z location of the structurebasePositionA - see class javadocbasePositionB - see class javadocbasePositionC - see class javadocelementBudget - build up to this many elementssource - from where to drain resourceactor - source of actioncheck - whether IStructureElement.check(Object, World, int, int, int) should be called if anything
+ would be placed. use with caution.
+ if in doubt, call check(Object, String, World, ExtendedFacing, int, int, int, int, int, int, boolean)
+ after this call and set this parameter to falsebuild(Object, ItemStack, String, World, ExtendedFacing, int, int, int, int, int, int)default int survivalBuild(T object, + ItemStack trigger, + String piece, + World world, + ExtendedFacing extendedFacing, + int basePositionX, + int basePositionY, + int basePositionZ, + int basePositionA, + int basePositionB, + int basePositionC, + int elementBudget, + ISurvivalBuildEnvironment env, + boolean check)+
object - context object. usually multiblock controller.trigger - The trigger item that contains channel data.piece - the structure piece's string identifier.world - the world object this check takes place in.extendedFacing - the current structure's orientation.basePositionX - X location of the structurebasePositionY - Y location of the structurebasePositionZ - Z location of the structurebasePositionA - see class javadocbasePositionB - see class javadocbasePositionC - see class javadocelementBudget - build up to this many elementsenv - build environment.check - whether IStructureElement.check(Object, World, int, int, int) should be called if anything
+ would be placed. use with caution.
+ if in doubt, call check(Object, String, World, ExtendedFacing, int, int, int, int, int, int, boolean)
+ after this call and set this parameter to falsebuild(Object, ItemStack, String, World, ExtendedFacing, int, int, int, int, int, int)static <T> boolean iterate(T object, + ItemStack trigger, + IStructureElement<T>[] elements, + World world, + ExtendedFacing extendedFacing, + int basePositionX, + int basePositionY, + int basePositionZ, + int basePositionA, + int basePositionB, + int basePositionC, + boolean hintsOnly, + Boolean checkBlocksIfNotNullForceCheckAllIfTrue)+
T - type of context object.object - context object. usually multiblock controller.trigger - The trigger item that contains channel data.elements - the structure pieceworld - the world object this check takes place in.extendedFacing - the current structure's orientation.basePositionX - X location of the structurebasePositionY - Y location of the structurebasePositionZ - Z location of the structurebasePositionA - see class javadocbasePositionB - see class javadocbasePositionC - see class javadochintsOnly - whether to spawn hints or do creative build. no effect if checkBlocksIfNotNullForceCheckAllIfTrue is not null.checkBlocksIfNotNullForceCheckAllIfTrue - creative build or spawn hints if null. Force check not loaded chunk
+ if true. Check only loaded chunk is false.static <T> StructureDefinition.Builder<T> builder()+
T - type of context objectpublic static final class IStructureElement.BlocksToPlace +extends Object+
| Modifier and Type | +Field and Description | +
|---|---|
static IStructureElement.BlocksToPlace |
+errored |
+
| Modifier and Type | +Method and Description | +
|---|---|
static IStructureElement.BlocksToPlace |
+create(Block block,
+ int meta) |
+
static IStructureElement.BlocksToPlace |
+create(Item item,
+ int meta) |
+
static IStructureElement.BlocksToPlace |
+create(ItemStack... stacks) |
+
static IStructureElement.BlocksToPlace |
+create(ItemStack itemStack) |
+
static IStructureElement.BlocksToPlace |
+create(Iterable<ItemStack> stacks) |
+
static IStructureElement.BlocksToPlace |
+create(Predicate<ItemStack> predicate) |
+
static IStructureElement.BlocksToPlace |
+createEmpty() |
+
Predicate<ItemStack> |
+getPredicate()
+Get the blocks to place filter.
+ |
+
Iterable<ItemStack> |
+getStacks()
+Get the ItemStacks that this one is known to accept.
+ |
+
public static final IStructureElement.BlocksToPlace errored+
public static IStructureElement.BlocksToPlace createEmpty()+
public static IStructureElement.BlocksToPlace create(ItemStack... stacks)+
public static IStructureElement.BlocksToPlace create(Iterable<ItemStack> stacks)+
public static IStructureElement.BlocksToPlace create(Block block, + int meta)+
public static IStructureElement.BlocksToPlace create(Item item, + int meta)+
public static IStructureElement.BlocksToPlace create(ItemStack itemStack)+
public static IStructureElement.BlocksToPlace create(Predicate<ItemStack> predicate)+
@Nonnull +public Predicate<ItemStack> getPredicate()+
+ Suitable for use with IItemSource.takeOne(Predicate, boolean)
@Nullable +public Iterable<ItemStack> getStacks()+
+ Suitable for use with IItemSource.takeOne(ItemStack, boolean).
+
+ This should be equivalent to the predicate returned from getPredicate()
public static enum IStructureElement.PlaceResult +extends Enum<IStructureElement.PlaceResult>+
| Enum Constant and Description | +
|---|
ACCEPT
+Element placed successfully.
+ |
+
ACCEPT_STOP
+Combination of ACCEPT and STOP.
+ |
+
REJECT
+This element's space is occupied by other stuff and require player attention, or player missing required resource,
+ or the block cannot be placed due to obscure mechanisms, or some other unforeseen situations.
+ |
+
SKIP
+This element either exists already, or does not yet have an implementation for survivalPlaceBlock, or
+ some other unforeseen situations.
+ |
+
STOP
+Autoplace cannot proceed within this tick.
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
static IStructureElement.PlaceResult |
+valueOf(String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static IStructureElement.PlaceResult[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
public static final IStructureElement.PlaceResult SKIP+
public static final IStructureElement.PlaceResult REJECT+
public static final IStructureElement.PlaceResult STOP+
public static final IStructureElement.PlaceResult ACCEPT+
public static final IStructureElement.PlaceResult ACCEPT_STOP+
+ Element placed successfully. To proceed further would require stopping the placement and wait for next round.
public static IStructureElement.PlaceResult[] values()+
+for (IStructureElement.PlaceResult c : IStructureElement.PlaceResult.values()) + System.out.println(c); +
public static IStructureElement.PlaceResult valueOf(String name)+
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic interface IStructureElement<T>
+IStructureDefinition. It represents
+ what a particular element can be and how this particular element should be autoplaced.| Modifier and Type | +Interface and Description | +
|---|---|
static class |
+IStructureElement.BlocksToPlace |
+
static class |
+IStructureElement.PlaceResult |
+
| Modifier and Type | +Method and Description | +
|---|---|
boolean |
+check(T t,
+ World world,
+ int x,
+ int y,
+ int z) |
+
default IStructureElement.BlocksToPlace |
+getBlocksToPlace(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ AutoPlaceEnvironment env)
+A simplified version of survivalPlaceBlock.
+ |
+
default int |
+getStepA() |
+
default int |
+getStepB() |
+
default int |
+getStepC() |
+
default boolean |
+isNavigating() |
+
default IStructureElementNoPlacement<T> |
+noPlacement()
+Forget the messed up class dependency graph for now.
+ |
+
boolean |
+placeBlock(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger) |
+
default boolean |
+resetA() |
+
default boolean |
+resetB() |
+
default boolean |
+resetC() |
+
boolean |
+spawnHint(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger) |
+
default IStructureElement.PlaceResult |
+survivalPlaceBlock(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ AutoPlaceEnvironment env)
+Try place the block by taking resource from given
+IItemSource. |
+
default IStructureElement.PlaceResult |
+survivalPlaceBlock(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ IItemSource s,
+ EntityPlayerMP actor,
+ Consumer<IChatComponent> chatter)
+Deprecated.
+
+caller should call the non deprecated overload. implementor for reusable
+IStructureElement
+ should still implement this. implementor for private implementations can freely ignore this as long as you know
+ the caller will not call this overload. |
+
boolean spawnHint(T t, + World world, + int x, + int y, + int z, + ItemStack trigger)+
boolean placeBlock(T t, + World world, + int x, + int y, + int z, + ItemStack trigger)+
@Deprecated +default IStructureElement.PlaceResult survivalPlaceBlock(T t, + World world, + int x, + int y, + int z, + ItemStack trigger, + IItemSource s, + EntityPlayerMP actor, + Consumer<IChatComponent> chatter)+
IStructureElement
+ should still implement this. implementor for private implementations can freely ignore this as long as you know
+ the caller will not call this overload.
+ You might want to use StructureUtility.survivalPlaceBlock(Block, int, World, int, int, int, IItemSource, net.minecraft.entity.player.EntityPlayer)
+ or its overloads to implement this.
trigger - trigger items - drain resources from this placeactor - source of action. for very critical errors you can also just send the error messages here, bypassing
+ any filter that chatter might have.chatter - send error messages here. Caller will choose an appropriate way to forward it to player if the
+ other fallbacks also fails.@Nullable +default IStructureElement.BlocksToPlace getBlocksToPlace(T t, + World world, + int x, + int y, + int z, + ItemStack trigger, + AutoPlaceEnvironment env)+
+ BY OVERRIDING THIS TO NULL, YOU ACKNOWLEDGE THAT THE check(Object, World, int, int, int) OF THIS
+ CLASS IS SIDE EFFECT FREE AND CAN HAVE ITS CHECK CALLED WITHOUT BREAKING ANYTHING. OTHERWISE OVERRIDE THE
+ survivalPlaceBlock(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment) TO PROVIDE A SIDEEFFECT
+ FREE IStructureElement.PlaceResult.SKIP.
+
+ It should be noticed that this filter is only advisory and the actual survivalPlaceBlock(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment)
+ or check(Object, World, int, int, int) are free to reject/accept/place blocks not contained in this list,
+ e.g. when the element can be placed anywhere in the structure, but no more than 3 overall; when the structure
+ element cannot know all blocks it will accept at the time of calling; when this is backed by a legacy
+ IStructureElement that just didn't implement this API.
trigger - trigger itemenv - autoplacing environmentsurvivalPlaceBlock(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment)default IStructureElement.PlaceResult survivalPlaceBlock(T t, + World world, + int x, + int y, + int z, + ItemStack trigger, + AutoPlaceEnvironment env)+
IItemSource.
+
+ You might want to use StructureUtility.survivalPlaceBlock(Block, int, World, int, int, int, IItemSource, net.minecraft.entity.player.EntityPlayer)
+ or its overloads to implement this.
+
+ The default implementation provided will +
IStructureElement.BlocksToPlace via getBlocksToPlace(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment). If not null
+ check(Object, World, int, int, int). If this returns true, IStructureElement.PlaceResult.SKIP will be returned without further action.IStructureElement.BlocksToPlace retrieved earlier and passed in IItemSource to determine an item to placeStructureUtility#survivalPlaceBlock(ItemStack, NBTMode, NBTTagCompound, boolean, World, int, int, int, IItemSource, EntityPlayer, Consumer)survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer) if env.getActor() contains an EntityPlayerMPIStructureElement.PlaceResult.SKIPcheck(Object, World, int, int, int) is not side effect free, or is not idempotent.
+ E.g. the check(Object, World, int, int, int) will add current coord to a List. As
+ this method might be invoked at a location that is already accepted, this will cause the machine to have multiple
+ of this coord in its list.trigger - trigger itemenv - autoplacing environmentdefault IStructureElementNoPlacement<T> noPlacement()+
default int getStepA()+
default int getStepB()+
default int getStepC()+
default boolean resetA()+
default boolean resetB()+
default boolean resetC()+
default boolean isNavigating()+
public interface IStructureElementChain<T> +extends IStructureElement<T>+
IStructureElement.BlocksToPlace, IStructureElement.PlaceResult| Modifier and Type | +Method and Description | +
|---|---|
default boolean |
+check(T t,
+ World world,
+ int x,
+ int y,
+ int z) |
+
IStructureElement<T>[] |
+fallbacks() |
+
default IStructureElement.BlocksToPlace |
+getBlocksToPlace(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ AutoPlaceEnvironment env)
+A simplified version of survivalPlaceBlock.
+ |
+
default boolean |
+placeBlock(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger) |
+
default boolean |
+spawnHint(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger) |
+
default IStructureElement.PlaceResult |
+survivalPlaceBlock(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ AutoPlaceEnvironment env)
+Try place the block by taking resource from given
+IItemSource. |
+
default IStructureElement.PlaceResult |
+survivalPlaceBlock(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ IItemSource s,
+ EntityPlayerMP actor,
+ Consumer<IChatComponent> chatter)
+Try place the block by taking resource from given IItemSource.
+ |
+
getStepA, getStepB, getStepC, isNavigating, noPlacement, resetA, resetB, resetCIStructureElement<T>[] fallbacks()+
default boolean check(T t, + World world, + int x, + int y, + int z)+
check in interface IStructureElement<T>default boolean spawnHint(T t, + World world, + int x, + int y, + int z, + ItemStack trigger)+
spawnHint in interface IStructureElement<T>default boolean placeBlock(T t, + World world, + int x, + int y, + int z, + ItemStack trigger)+
placeBlock in interface IStructureElement<T>@Nullable +default IStructureElement.BlocksToPlace getBlocksToPlace(T t, + World world, + int x, + int y, + int z, + ItemStack trigger, + AutoPlaceEnvironment env)+
IStructureElement
+ BY OVERRIDING THIS TO NULL, YOU ACKNOWLEDGE THAT THE IStructureElement.check(Object, World, int, int, int) OF THIS
+ CLASS IS SIDE EFFECT FREE AND CAN HAVE ITS CHECK CALLED WITHOUT BREAKING ANYTHING. OTHERWISE OVERRIDE THE
+ IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment) TO PROVIDE A SIDEEFFECT
+ FREE IStructureElement.PlaceResult.SKIP.
+
+ It should be noticed that this filter is only advisory and the actual IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment)
+ or IStructureElement.check(Object, World, int, int, int) are free to reject/accept/place blocks not contained in this list,
+ e.g. when the element can be placed anywhere in the structure, but no more than 3 overall; when the structure
+ element cannot know all blocks it will accept at the time of calling; when this is backed by a legacy
+ IStructureElement that just didn't implement this API.
getBlocksToPlace in interface IStructureElement<T>trigger - trigger itemenv - autoplacing environmentIStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment)default IStructureElement.PlaceResult survivalPlaceBlock(T t, + World world, + int x, + int y, + int z, + ItemStack trigger, + IItemSource s, + EntityPlayerMP actor, + Consumer<IChatComponent> chatter)+
IStructureElement
+ You might want to use StructureUtility.survivalPlaceBlock(Block, int, World, int, int, int, IItemSource, net.minecraft.entity.player.EntityPlayer)
+ or its overloads to implement this.
survivalPlaceBlock in interface IStructureElement<T>trigger - trigger items - drain resources from this placeactor - source of action. for very critical errors you can also just send the error messages here, bypassing
+ any filter that chatter might have.chatter - send error messages here. Caller will choose an appropriate way to forward it to player if the
+ other fallbacks also fails.default IStructureElement.PlaceResult survivalPlaceBlock(T t, + World world, + int x, + int y, + int z, + ItemStack trigger, + AutoPlaceEnvironment env)+
IStructureElementIItemSource.
+
+ You might want to use StructureUtility.survivalPlaceBlock(Block, int, World, int, int, int, IItemSource, net.minecraft.entity.player.EntityPlayer)
+ or its overloads to implement this.
+
+ The default implementation provided will +
IStructureElement.BlocksToPlace via IStructureElement.getBlocksToPlace(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment). If not null
+ IStructureElement.check(Object, World, int, int, int). If this returns true, IStructureElement.PlaceResult.SKIP will be returned without further action.IStructureElement.BlocksToPlace retrieved earlier and passed in IItemSource to determine an item to placeStructureUtility#survivalPlaceBlock(ItemStack, NBTMode, NBTTagCompound, boolean, World, int, int, int, IItemSource, EntityPlayer, Consumer)IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer) if env.getActor() contains an EntityPlayerMPIStructureElement.PlaceResult.SKIPIStructureElement.check(Object, World, int, int, int) is not side effect free, or is not idempotent.
+ E.g. the IStructureElement.check(Object, World, int, int, int) will add current coord to a List. As
+ this method might be invoked at a location that is already accepted, this will cause the machine to have multiple
+ of this coord in its list.survivalPlaceBlock in interface IStructureElement<T>trigger - trigger itemenv - autoplacing environmentpublic interface IStructureElementCheckOnly<T> +extends IStructureElement<T>+
IStructureElement.BlocksToPlace, IStructureElement.PlaceResult| Modifier and Type | +Method and Description | +
|---|---|
default boolean |
+placeBlock(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger) |
+
default boolean |
+spawnHint(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger) |
+
default IStructureElement.PlaceResult |
+survivalPlaceBlock(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ AutoPlaceEnvironment env)
+Try place the block by taking resource from given
+IItemSource. |
+
default IStructureElement.PlaceResult |
+survivalPlaceBlock(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ IItemSource s,
+ EntityPlayerMP actor,
+ Consumer<IChatComponent> chatter)
+Try place the block by taking resource from given IItemSource.
+ |
+
check, getBlocksToPlace, getStepA, getStepB, getStepC, isNavigating, noPlacement, resetA, resetB, resetCdefault boolean placeBlock(T t, + World world, + int x, + int y, + int z, + ItemStack trigger)+
placeBlock in interface IStructureElement<T>default boolean spawnHint(T t, + World world, + int x, + int y, + int z, + ItemStack trigger)+
spawnHint in interface IStructureElement<T>default IStructureElement.PlaceResult survivalPlaceBlock(T t, + World world, + int x, + int y, + int z, + ItemStack trigger, + IItemSource s, + EntityPlayerMP actor, + Consumer<IChatComponent> chatter)+
IStructureElement
+ You might want to use StructureUtility.survivalPlaceBlock(Block, int, World, int, int, int, IItemSource, net.minecraft.entity.player.EntityPlayer)
+ or its overloads to implement this.
survivalPlaceBlock in interface IStructureElement<T>trigger - trigger items - drain resources from this placeactor - source of action. for very critical errors you can also just send the error messages here, bypassing
+ any filter that chatter might have.chatter - send error messages here. Caller will choose an appropriate way to forward it to player if the
+ other fallbacks also fails.default IStructureElement.PlaceResult survivalPlaceBlock(T t, + World world, + int x, + int y, + int z, + ItemStack trigger, + AutoPlaceEnvironment env)+
IStructureElementIItemSource.
+
+ You might want to use StructureUtility.survivalPlaceBlock(Block, int, World, int, int, int, IItemSource, net.minecraft.entity.player.EntityPlayer)
+ or its overloads to implement this.
+
+ The default implementation provided will +
IStructureElement.BlocksToPlace via IStructureElement.getBlocksToPlace(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment). If not null
+ IStructureElement.check(Object, World, int, int, int). If this returns true, IStructureElement.PlaceResult.SKIP will be returned without further action.IStructureElement.BlocksToPlace retrieved earlier and passed in IItemSource to determine an item to placeStructureUtility#survivalPlaceBlock(ItemStack, NBTMode, NBTTagCompound, boolean, World, int, int, int, IItemSource, EntityPlayer, Consumer)IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer) if env.getActor() contains an EntityPlayerMPIStructureElement.PlaceResult.SKIPIStructureElement.check(Object, World, int, int, int) is not side effect free, or is not idempotent.
+ E.g. the IStructureElement.check(Object, World, int, int, int) will add current coord to a List. As
+ this method might be invoked at a location that is already accepted, this will cause the machine to have multiple
+ of this coord in its list.survivalPlaceBlock in interface IStructureElement<T>trigger - trigger itemenv - autoplacing environmentpublic interface IStructureElementDeferred<T> +extends IStructureElement<T>+
IStructureElement.BlocksToPlace, IStructureElement.PlaceResultcheck, getBlocksToPlace, getStepA, getStepB, getStepC, isNavigating, noPlacement, placeBlock, resetA, resetB, resetC, spawnHint, survivalPlaceBlock, survivalPlaceBlockpublic interface IStructureElementNoPlacement<T> +extends IStructureElement<T>+
IStructureElement.BlocksToPlace, IStructureElement.PlaceResult| Modifier and Type | +Method and Description | +
|---|---|
default IStructureElementNoPlacement<T> |
+noPlacement()
+Forget the messed up class dependency graph for now.
+ |
+
default boolean |
+placeBlock(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger) |
+
default IStructureElement.PlaceResult |
+survivalPlaceBlock(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ AutoPlaceEnvironment env)
+Try place the block by taking resource from given
+IItemSource. |
+
default IStructureElement.PlaceResult |
+survivalPlaceBlock(T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ IItemSource s,
+ EntityPlayerMP actor,
+ Consumer<IChatComponent> chatter)
+Try place the block by taking resource from given IItemSource.
+ |
+
check, getBlocksToPlace, getStepA, getStepB, getStepC, isNavigating, resetA, resetB, resetC, spawnHintdefault boolean placeBlock(T t, + World world, + int x, + int y, + int z, + ItemStack trigger)+
placeBlock in interface IStructureElement<T>default IStructureElement.PlaceResult survivalPlaceBlock(T t, + World world, + int x, + int y, + int z, + ItemStack trigger, + IItemSource s, + EntityPlayerMP actor, + Consumer<IChatComponent> chatter)+
IStructureElement
+ You might want to use StructureUtility.survivalPlaceBlock(Block, int, World, int, int, int, IItemSource, net.minecraft.entity.player.EntityPlayer)
+ or its overloads to implement this.
survivalPlaceBlock in interface IStructureElement<T>trigger - trigger items - drain resources from this placeactor - source of action. for very critical errors you can also just send the error messages here, bypassing
+ any filter that chatter might have.chatter - send error messages here. Caller will choose an appropriate way to forward it to player if the
+ other fallbacks also fails.default IStructureElement.PlaceResult survivalPlaceBlock(T t, + World world, + int x, + int y, + int z, + ItemStack trigger, + AutoPlaceEnvironment env)+
IStructureElementIItemSource.
+
+ You might want to use StructureUtility.survivalPlaceBlock(Block, int, World, int, int, int, IItemSource, net.minecraft.entity.player.EntityPlayer)
+ or its overloads to implement this.
+
+ The default implementation provided will +
IStructureElement.BlocksToPlace via IStructureElement.getBlocksToPlace(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment). If not null
+ IStructureElement.check(Object, World, int, int, int). If this returns true, IStructureElement.PlaceResult.SKIP will be returned without further action.IStructureElement.BlocksToPlace retrieved earlier and passed in IItemSource to determine an item to placeStructureUtility#survivalPlaceBlock(ItemStack, NBTMode, NBTTagCompound, boolean, World, int, int, int, IItemSource, EntityPlayer, Consumer)IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer) if env.getActor() contains an EntityPlayerMPIStructureElement.PlaceResult.SKIPIStructureElement.check(Object, World, int, int, int) is not side effect free, or is not idempotent.
+ E.g. the IStructureElement.check(Object, World, int, int, int) will add current coord to a List. As
+ this method might be invoked at a location that is already accepted, this will cause the machine to have multiple
+ of this coord in its list.survivalPlaceBlock in interface IStructureElement<T>trigger - trigger itemenv - autoplacing environmentdefault IStructureElementNoPlacement<T> noPlacement()+
IStructureElementnoPlacement in interface IStructureElement<T>public interface ISurvivalBuildEnvironment
+| Modifier and Type | +Method and Description | +
|---|---|
static ISurvivalBuildEnvironment |
+create(IItemSource source,
+ EntityPlayer actor)
+Create a default implementation with three parameters all being constants.
+ |
+
EntityPlayer |
+getActor()
+Get the origin of action.
+ |
+
IItemSource |
+getSource()
+Get the source of the items.
+ |
+
IItemSource getSource()+
+ If the call chain ever got into the old API, this will be called at least once per IStructureDefinition.survivalBuild(Object, ItemStack, String, World, ExtendedFacing, int, int, int, int, int, int, int, ISurvivalBuildEnvironment, boolean) call.
EntityPlayer getActor()+
IStructureDefinition.survivalBuild(Object, ItemStack, String, World, ExtendedFacing, int, int, int, int, int, int, int, ISurvivalBuildEnvironment, boolean) call.static ISurvivalBuildEnvironment create(IItemSource source, + EntityPlayer actor)+
source - from where to drain resourceactor - source of actionTIER - @FunctionalInterface +public interface ITierConverter<TIER>+
| Modifier and Type | +Method and Description | +
|---|---|
TIER |
+convert(Block block,
+ int meta) |
+
CTX - the temporary state contextpublic interface IWithExtendedContext<CTX>
+StructureUtility.withContext(IStructureElement) in case you need to record some
+ temporary states that don't need to live in your main context, which would usually live for the whole lifetime of the
+ structure than just during structure check. Usually just save some few bytes, but becomes non-trivial if you need to
+ record too much stuff.
+ + You will have to reset the context yourself though. The API can't guess when the old context becomes invalid.
| Modifier and Type | +Method and Description | +
|---|---|
CTX |
+getCurrentContext() |
+
public static class StructureDefinition.Builder<T> +extends Object+
| Modifier and Type | +Method and Description | +
|---|---|
StructureDefinition.Builder<T> |
+addElement(Character name,
+ IStructureElement<T> structurePiece)
+Deprecated.
+
+use the unboxed version
+ |
+
StructureDefinition.Builder<T> |
+addElement(char name,
+ IStructureElement<T> structurePiece) |
+
StructureDefinition.Builder<T> |
+addShape(String name,
+ String[][] structurePiece)
+Adds shape.
+ |
+
IStructureDefinition<T> |
+build() |
+
Map<Character,IStructureElement<T>> |
+getElements() |
+
Map<String,String> |
+getShapes() |
+
public Map<Character,IStructureElement<T>> getElements()+
public StructureDefinition.Builder<T> addShape(String name, + String[][] structurePiece)+
IStructureElement as indicated by addElement(Character, IStructureElement).
+ + next char is next block(a) + next string is next line(b) + next string[] is next slice(c) +
+ There are a few special reserved characters that are pre-mapped to some common structure elements +
A000-FFFF range is reserved for generated skipsname - unlocalized/code namestructurePiece - generated or written struct - DO NOT STORE IT ANYWHERE, or at least set them to null afterwards@Deprecated +public StructureDefinition.Builder<T> addElement(Character name, + IStructureElement<T> structurePiece)+
public StructureDefinition.Builder<T> addElement(char name, + IStructureElement<T> structurePiece)+
public IStructureDefinition<T> build()+
public class StructureDefinition<T> +extends Object +implements IStructureDefinition<T>+
| Modifier and Type | +Class and Description | +
|---|---|
static class |
+StructureDefinition.Builder<T> |
+
| Modifier and Type | +Method and Description | +
|---|---|
static <B> StructureDefinition.Builder<B> |
+builder()
+Create a new instance of builder.
+ |
+
Map<Character,IStructureElement<T>> |
+getElements() |
+
Map<String,String> |
+getShapes() |
+
IStructureElement<T>[] |
+getStructureFor(String name)
+Used internally
+ |
+
Map<String,IStructureElement<T>[]> |
+getStructures() |
+
boolean |
+isContainedInStructure(String name,
+ int offsetA,
+ int offsetB,
+ int offsetC) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuild, buildOrHints, check, hints, iterate, survivalBuild, survivalBuildpublic static <B> StructureDefinition.Builder<B> builder()+
IStructureDefinitionbuilder in interface IStructureDefinition<T>B - type of context objectpublic Map<Character,IStructureElement<T>> getElements()+
public Map<String,IStructureElement<T>[]> getStructures()+
public IStructureElement<T>[] getStructureFor(String name)+
IStructureDefinition
+ Might, but is not required, to throw NoSuchElementException if the given structure piece is not found.
getStructureFor in interface IStructureDefinition<T>name - same name as for other methods herepublic boolean isContainedInStructure(String name, + int offsetA, + int offsetB, + int offsetC)+
isContainedInStructure in interface IStructureDefinition<T>public class StructureUtility +extends Object+
IStructureElement. However, in that
+ case javac generic will often fail to infer the type for you, so we have to define them as static methods
+ onlyIf(Predicate, IStructureElement) and its overloadspartitionBy(Function, IStructureElement[]) and its overloadsofChain(IStructureElement[]) and its overloadsonElementPass(Consumer, IStructureElement): Call an callback upon element check success onElementFail(Consumer, IStructureElement): Call an callback upon element check failure error()withContext(IStructureElement): switch context to the extended contextwithChannel(String, IStructureElement): switch channel using ChannelDataAccessor.withChannel(ItemStack, String) when a trigger item is present.ofHint(int), ofHintDeferred(Supplier) and its overloadsIStructureElement implementations.
+ ofBlock(Block, int, Block, int), ofBlocksFlat(Map, Block, int), ofBlocksMap(Map, Block, int)
+ and their overloads: the most basic formofBlockHint(Block, int, Block, int), ofBlocksFlatHint(Map, Block, int), ofBlocksMapHint(Map, Block, int):
+ these are the same as above, but will not do autoplaceisAir(), notAir(): They are supplied by default under the identifier '-' and '+'
+ respectively, but are provided here regardless in case you want to use them as a fallback.ofBlockAdder(IBlockAdder, Block, int), ofBlockAdderHint(IBlockAdder, Block, int) and their
+ overloads: hands off actual adder logic to an IBlockAdder you supplied. Save you the boilerplate of querying
+ block type and block meta from WorldofBlocksTiered(ITierConverter, Object, BiConsumer, Function) and its overloads: accept a series of
+ blocks that each may have different tier, but only allow one single tier for anywhere this element is used (e.g. coils).ofTileAdder(ITileAdder, Block, int), ofSpecificTileAdder(BiPredicate, Class, Block, int):
+ Similar to block adder, but for tile entities.IStructureElement, but is helpful to the instantiation or implementation of these.
+ survivalPlaceBlock(Block, int, World, int, int, int, IItemSource, EntityPlayer, Consumer) and its overloads:
+ Helper method to cut common boilerplate for implementing IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)getPseudoJavaCode(World, ExtendedFacing, int, int, int, int, int, int, Function, int, int, int, boolean):
+ Generate a structure code template from existing structure.iterate(World, ExtendedFacing, int, int, int, int, int, int, boolean, int, int, int, IBlockPosConsumer, Runnable, Runnable)
+ and its overloads: help iterate over a coordinate space.| Modifier and Type | +Method and Description | +
|---|---|
static <T> IStructureElementDeferred<T> |
+defer(BiFunction<T,ItemStack,Integer> keyExtractor,
+ IStructureElement<T>... array)
+This is the switch block for structure code.
+ |
+
static <T> IStructureElementDeferred<T> |
+defer(BiFunction<T,ItemStack,Integer> keyExtractor,
+ List<IStructureElement<T>> array)
+This is the switch block for structure code.
+ |
+
static <T> IStructureElementDeferred<T> |
+defer(BiFunction<T,ItemStack,IStructureElement<T>> to)
+This will defer the actual instantiation of structure element until the structure code is actually called.
+ |
+
static <T,K> IStructureElementDeferred<T> |
+defer(BiFunction<T,ItemStack,K> keyExtractor,
+ Map<K,IStructureElement<T>> map)
+Deprecated.
+
+renamed to partitionBy
+ |
+
static <T,K> IStructureElementDeferred<T> |
+defer(BiFunction<T,ItemStack,K> keyExtractor,
+ Map<K,IStructureElement<T>> map,
+ IStructureElement<T> defaultElem)
+Deprecated.
+
+renamed to partitionBy
+ |
+
static <T> IStructureElementDeferred<T> |
+defer(Function<T,Integer> keyExtractorCheck,
+ BiFunction<T,ItemStack,Integer> keyExtractor,
+ IStructureElement<T>... array)
+Deprecated.
+
+renamed to partitionBy
+ |
+
static <T> IStructureElementDeferred<T> |
+defer(Function<T,Integer> keyExtractorCheck,
+ BiFunction<T,ItemStack,Integer> keyExtractor,
+ List<IStructureElement<T>> array)
+Deprecated.
+
+renamed to partitionBy
+ |
+
static <T> IStructureElementDeferred<T> |
+defer(Function<T,Integer> keyExtractor,
+ IStructureElement<T>... array)
+Deprecated.
+
+renamed to partitionBy
+ |
+
static <T> IStructureElementDeferred<T> |
+defer(Function<T,Integer> keyExtractor,
+ List<IStructureElement<T>> array)
+Deprecated.
+
+renamed to partitionBy
+ |
+
static <T> IStructureElementDeferred<T> |
+defer(Function<T,IStructureElement<T>> to)
+This will defer the actual instantiation of structure element until the structure code is actually called.
+ |
+
static <T> IStructureElementDeferred<T> |
+defer(Function<T,IStructureElement<T>> toCheck,
+ BiFunction<T,ItemStack,IStructureElement<T>> to)
+This will defer the actual instantiation of structure element until the first time structure code is actually called.
+ |
+
static <T,K> IStructureElementDeferred<T> |
+defer(Function<T,K> keyExtractorCheck,
+ BiFunction<T,ItemStack,K> keyExtractor,
+ Map<K,IStructureElement<T>> map)
+Deprecated.
+
+renamed to partitionBy
+ |
+
static <T,K> IStructureElementDeferred<T> |
+defer(Function<T,K> keyExtractorCheck,
+ BiFunction<T,ItemStack,K> keyExtractor,
+ Map<K,IStructureElement<T>> map,
+ IStructureElement<T> defaultElem)
+Deprecated.
+
+renamed to partitionBy
+ |
+
static <T,K> IStructureElementDeferred<T> |
+defer(Function<T,K> keyExtractor,
+ Map<K,IStructureElement<T>> map)
+Deprecated.
+
+renamed to partitionBy
+ |
+
static <T,K> IStructureElementDeferred<T> |
+defer(Function<T,K> keyExtractor,
+ Map<K,IStructureElement<T>> map,
+ IStructureElement<T> defaultElem)
+Deprecated.
+
+renamed to partitionBy
+ |
+
static <T> IStructureElementDeferred<T> |
+defer(Supplier<IStructureElement<T>> to)
+This will defer the actual instantiation of structure element until the structure code is actually called.
+ |
+
static <T> IStructureElement<T> |
+error()
+Check returns false.
+ |
+
static String |
+getPseudoJavaCode(World world,
+ ExtendedFacing extendedFacing,
+ int basePositionX,
+ int basePositionY,
+ int basePositionZ,
+ int basePositionA,
+ int basePositionB,
+ int basePositionC,
+ Function<? super TileEntity,String> tileEntityClassifier,
+ int sizeA,
+ int sizeB,
+ int sizeC,
+ boolean transpose)
+Used only to get pseudo code in structure writer...
+ |
+
static <T> IStructureElement<T> |
+isAir()
+Return a structure element that only allow air (or air equivalents, like Railcraft hidden blocks).
+ |
+
static void |
+iterate(World world,
+ ExtendedFacing extendedFacing,
+ int basePositionX,
+ int basePositionY,
+ int basePositionZ,
+ int basePositionA,
+ int basePositionB,
+ int basePositionC,
+ boolean transpose,
+ int sizeA,
+ int sizeB,
+ int sizeC,
+ IBlockPosConsumer iBlockPosConsumer,
+ Runnable nextB,
+ Runnable nextC) |
+
static void |
+iterate(World world,
+ ExtendedFacing extendedFacing,
+ int basePositionX,
+ int basePositionY,
+ int basePositionZ,
+ int basePositionA,
+ int basePositionB,
+ int basePositionC,
+ int sizeA,
+ int sizeB,
+ int sizeC,
+ IBlockPosConsumer iBlockPosConsumer) |
+
static <T> IStructureElementDeferred<T> |
+lazy(Function<T,IStructureElement<T>> to)
+This will defer the actual instantiation of structure element until the first time structure code is actually called.
+ |
+
static <T> IStructureElementDeferred<T> |
+lazy(Supplier<IStructureElement<T>> to)
+Similar to defer, but caches the first returned element returned and won't call it again.
+ |
+
static <T> IStructureElement<T> |
+notAir()
+Return a structure element that allow anything but air (or air equivalents, like Railcraft hidden blocks).
+ |
+
static <T> IStructureElement<T> |
+ofBlock(Block block,
+ int meta)
+Accept a single block with a fixed meta.
+ |
+
static <T> IStructureElement<T> |
+ofBlock(Block block,
+ int meta,
+ Block defaultBlock,
+ int defaultMeta)
+Accept a block.
+ |
+
static <T> IStructureElement<T> |
+ofBlockAdder(IBlockAdder<T> iBlockAdder,
+ Block defaultBlock,
+ int defaultMeta)
+Add a block using block adder.
+ |
+
static <T> IStructureElement<T> |
+ofBlockAdder(IBlockAdder<T> iBlockAdder,
+ int dots) |
+
static <T> IStructureElementNoPlacement<T> |
+ofBlockAdderHint(IBlockAdder<T> iBlockAdder,
+ Block hintBlock,
+ int hintMeta)
+Add a block using block adder.
+ |
+
static <T> IStructureElement<T> |
+ofBlockAnyMeta(Block block)
+Accept a single block, but accept any meta.
+ |
+
static <T> IStructureElement<T> |
+ofBlockAnyMeta(Block block,
+ Block defaultBlock,
+ int defaultMeta)
+Same as
+ofBlock(Block, int, Block, int) but ignores target meta id |
+
static <T> IStructureElement<T> |
+ofBlockAnyMeta(Block block,
+ int defaultMeta)
+Accept a single block, but accept any meta.
+ |
+
static <T> IStructureElementNoPlacement<T> |
+ofBlockHint(Block block,
+ int meta)
+Accept one (block, meta).
+ |
+
static <T> IStructureElementNoPlacement<T> |
+ofBlockHint(Block block,
+ int meta,
+ Block hintBlock,
+ int hintMeta)
+Accept one (block, meta).
+ |
+
static <T> IStructureElement<T> |
+ofBlocksFlat(Map<Block,Integer> blocsMap,
+ Block defaultBlock,
+ int defaultMeta)
+Accept a set of blocks.
+ |
+
static <T> IStructureElementNoPlacement<T> |
+ofBlocksFlatHint(Map<Block,Integer> blocsMap,
+ Block hintBlock,
+ int hintMeta)
+Accept a set of blocks.
+ |
+
static <T> IStructureElement<T> |
+ofBlocksMap(Map<Block,Collection<Integer>> blocsMap,
+ Block defaultBlock,
+ int defaultMeta)
+Accept a set of blocks.
+ |
+
static <T> IStructureElementNoPlacement<T> |
+ofBlocksMapHint(Map<Block,Collection<Integer>> blocsMap,
+ Block hintBlock,
+ int hintMeta)
+Accept a set of blocks.
+ |
+
static <T,TIER> IStructureElement<T> |
+ofBlocksTiered(ITierConverter<TIER> tierExtractor,
+ List<org.apache.commons.lang3.tuple.Pair<Block,Integer>> allKnownTiers,
+ TIER notSet,
+ BiConsumer<T,TIER> setter,
+ Function<T,TIER> getter)
+Element representing a component with different tiers.
+ |
+
static <T,TIER> IStructureElementCheckOnly<T> |
+ofBlocksTiered(ITierConverter<TIER> tierExtractor,
+ TIER notSet,
+ BiConsumer<T,TIER> setter,
+ Function<T,TIER> getter)
+A more primitive variant of
+ofBlocksTiered(ITierConverter, List, Object, BiConsumer, Function)
+ Main difference is this one is check only. |
+
static <T> IStructureElement<T> |
+ofBlockUnlocalizedName(String modid,
+ String unlocalizedName,
+ int meta)
+Denote a block using unlocalized names.
+ |
+
static <T> IStructureElement<T> |
+ofBlockUnlocalizedName(String modid,
+ String registryName,
+ int meta,
+ boolean wildcard)
+Denote a block using unlocalized names.
+ |
+
static <T> IStructureElement<T> |
+ofBlockUnlocalizedName(String modid,
+ String unlocalizedName,
+ int meta,
+ IStructureElement<T> fallback)
+Similiar to the other overload, but allows client code to specify a fallback in case said block was not found later
+ when the element got called.
+ |
+
static <T> IStructureElementChain<T> |
+ofChain(IStructureElement<T>... elementChain)
+This allows you to compose different
+IStructureElement to form a OR chain. |
+
static <T> IStructureElementChain<T> |
+ofChain(List<IStructureElement<T>> elementChain)
+This allows you to compose different
+IStructureElement to form a OR chain. |
+
static <T> IStructureElementNoPlacement<T> |
+ofHint(int dots)
+Spawn a hint with given amount of dots.
+ |
+
static <T> IStructureElementNoPlacement<T> |
+ofHintDeferred(Supplier<IIcon[]> icons)
+Spawn a hint with given textures.
+ |
+
static <T> IStructureElementNoPlacement<T> |
+ofHintDeferred(Supplier<IIcon[]> icons,
+ short[] RGBa)
+Spawn a hint with given amount of textures and tint.
+ |
+
static <T,E> IStructureElementNoPlacement<T> |
+ofSpecificTileAdder(BiPredicate<T,E> iTileAdder,
+ Class<E> tileClass,
+ Block hintBlock,
+ int hintMeta)
+Try to add a structure element with a particular type of tile entity.
+ |
+
static <T> IStructureElementNoPlacement<T> |
+ofTileAdder(ITileAdder<T> iTileAdder,
+ Block hintBlock,
+ int hintMeta)
+Try to add a structure element with a tile entity.
+ |
+
static <B extends IStructureElement<T>,T> |
+onElementFail(Consumer<T> onFail,
+ B element)
+Call a callback if downstream element returned false in check.
+ |
+
static <B extends IStructureElement<T>,T> |
+onElementPass(Consumer<T> onCheckPass,
+ B element)
+Call a callback if downstream element returned true in check.
+ |
+
static <T> IStructureElement<T> |
+onlyIf(Predicate<? super T> predicate,
+ IStructureElement<? super T> downstream)
+Enable this structure element only if given predicate returns true.
+ |
+
static <T> IStructureElement<T> |
+onlyIf(Predicate<? super T> predicate,
+ IStructureElement<? super T> downstream,
+ IStructureElement.PlaceResult placeResultWhenDisabled)
+Enable this structure element only if given predicate returns true.
+ |
+
static <T,K> IStructureElementDeferred<T> |
+partitionBy(BiFunction<T,ItemStack,K> keyExtractor,
+ Map<K,IStructureElement<T>> map)
+This is the switch block for structure code.
+ |
+
static <T,K> IStructureElementDeferred<T> |
+partitionBy(BiFunction<T,ItemStack,K> keyExtractor,
+ Map<K,IStructureElement<T>> map,
+ IStructureElement<T> defaultElem)
+This is the switch block for structure code, with default case support.
+ |
+
static <T> IStructureElementDeferred<T> |
+partitionBy(Function<T,Integer> keyExtractorCheck,
+ BiFunction<T,ItemStack,Integer> keyExtractor,
+ IStructureElement<T>... array)
+This is the switch block for structure code, with default case.
+ |
+
static <T> IStructureElementDeferred<T> |
+partitionBy(Function<T,Integer> keyExtractorCheck,
+ BiFunction<T,ItemStack,Integer> keyExtractor,
+ List<IStructureElement<T>> array)
+This is the switch block for structure code, with default case.
+ |
+
static <T> IStructureElementDeferred<T> |
+partitionBy(Function<T,Integer> keyExtractor,
+ IStructureElement<T>... array)
+This is the switch block for structure code.
+ |
+
static <T> IStructureElementDeferred<T> |
+partitionBy(Function<T,Integer> keyExtractor,
+ List<IStructureElement<T>> array)
+This is the switch block for structure code.
+ |
+
static <T,K> IStructureElementDeferred<T> |
+partitionBy(Function<T,K> keyExtractorCheck,
+ BiFunction<T,ItemStack,K> keyExtractor,
+ Map<K,IStructureElement<T>> map)
+This is the switch block for structure code.
+ |
+
static <T,K> IStructureElementDeferred<T> |
+partitionBy(Function<T,K> keyExtractorCheck,
+ BiFunction<T,ItemStack,K> keyExtractor,
+ Map<K,IStructureElement<T>> map,
+ IStructureElement<T> defaultElem)
+This is the switch block for structure code, with default case.
+ |
+
static <T,K> IStructureElementDeferred<T> |
+partitionBy(Function<T,K> keyExtractor,
+ Map<K,IStructureElement<T>> map)
+This is the switch block for structure code.
+ |
+
static <T,K> IStructureElementDeferred<T> |
+partitionBy(Function<T,K> keyExtractor,
+ Map<K,IStructureElement<T>> map,
+ IStructureElement<T> defaultElem)
+This is the switch block for structure code, with default case support.
+ |
+
static <T> com.gtnewhorizon.structurelib.structure.IStructureNavigate<T> |
+step(int a,
+ int b,
+ int c)
+Used internally, to generate skips for structure definitions
+ |
+
static <T> com.gtnewhorizon.structurelib.structure.IStructureNavigate<T> |
+step(Vec3Impl step)
+Used internally, to generate skips for structure definitions
+ |
+
static IStructureElement.PlaceResult |
+survivalPlaceBlock(Block block,
+ int meta,
+ World world,
+ int x,
+ int y,
+ int z,
+ IItemSource s,
+ EntityPlayer actor)
+This is a helper method for implementing
+IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer) |
+
static IStructureElement.PlaceResult |
+survivalPlaceBlock(Block block,
+ int meta,
+ World world,
+ int x,
+ int y,
+ int z,
+ IItemSource s,
+ EntityPlayer actor,
+ Consumer<IChatComponent> chatter)
+This is a helper method for implementing
+IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer) |
+
static IStructureElement.PlaceResult |
+survivalPlaceBlock(Block block,
+ int meta,
+ World world,
+ int x,
+ int y,
+ int z,
+ IItemSource s,
+ EntityPlayerMP actor)
+This is a helper method for implementing
+IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer) |
+
static IStructureElement.PlaceResult |
+survivalPlaceBlock(Block block,
+ int meta,
+ World world,
+ int x,
+ int y,
+ int z,
+ IItemSource s,
+ EntityPlayerMP actor,
+ Consumer<IChatComponent> chatter)
+This is a helper method for implementing
+IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer) |
+
static IStructureElement.PlaceResult |
+survivalPlaceBlock(ItemStack stack,
+ ItemStackPredicate.NBTMode nbtMode,
+ NBTTagCompound tag,
+ boolean assumeStackPresent,
+ World world,
+ int x,
+ int y,
+ int z,
+ IItemSource s,
+ EntityPlayer actor)
+This is a helper method for implementing
+IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer) |
+
static IStructureElement.PlaceResult |
+survivalPlaceBlock(ItemStack stack,
+ ItemStackPredicate.NBTMode nbtMode,
+ NBTTagCompound tag,
+ boolean assumeStackPresent,
+ World world,
+ int x,
+ int y,
+ int z,
+ IItemSource s,
+ EntityPlayer actor,
+ Consumer<IChatComponent> chatter)
+This is a helper method for implementing
+IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer) |
+
static IStructureElement.PlaceResult |
+survivalPlaceBlock(ItemStack stack,
+ ItemStackPredicate.NBTMode nbtMode,
+ NBTTagCompound tag,
+ boolean assumeStackPresent,
+ World world,
+ int x,
+ int y,
+ int z,
+ IItemSource s,
+ EntityPlayerMP actor)
+This is a helper method for implementing
+IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer) |
+
static IStructureElement.PlaceResult |
+survivalPlaceBlock(ItemStack stack,
+ ItemStackPredicate.NBTMode nbtMode,
+ NBTTagCompound tag,
+ boolean assumeStackPresent,
+ World world,
+ int x,
+ int y,
+ int z,
+ IItemSource s,
+ EntityPlayerMP actor,
+ Consumer<IChatComponent> chatter)
+This is a helper method for implementing
+IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer) |
+
static String[][] |
+transpose(String[][] structurePiece)
+Transposes shape (swaps B and C axis, can be used to un-transpose transposed shape)
+ WARNING! Do not use on old api...
+ |
+
static <T> IStructureElement<T> |
+withChannel(String channel,
+ IStructureElement<T> backing)
+See channels.md in docs folder
+ |
+
static <CTX,T extends IWithExtendedContext<CTX>> |
+withContext(IStructureElement<CTX> elem)
+Switch to the extended context object in the downstream element
+ |
+
public static IStructureElement.PlaceResult survivalPlaceBlock(Block block, + int meta, + World world, + int x, + int y, + int z, + IItemSource s, + EntityPlayerMP actor)+
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)
+
+ This method will try to look up an ItemBlock for given block and meta from s and place it at given
+ location.
+ This method assume block at given coord is NOT acceptable, but may or may not be trivially replaceable
+ This method might yield error messages to the player only if there is likely a programming error or exploit.
s - drain resources from this placeactor - source of action. cannot be null.public static IStructureElement.PlaceResult survivalPlaceBlock(Block block, + int meta, + World world, + int x, + int y, + int z, + IItemSource s, + EntityPlayer actor)+
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)
+
+ This method will try to look up an ItemBlock for given block and meta from s and place it at given
+ location.
+ This method assume block at given coord is NOT acceptable, but may or may not be trivially replaceable
+ This method might yield error messages to the player only if there is likely a programming error or exploit.
s - drain resources from this placeactor - source of action. cannot be null.public static IStructureElement.PlaceResult survivalPlaceBlock(Block block, + int meta, + World world, + int x, + int y, + int z, + IItemSource s, + EntityPlayerMP actor, + Consumer<IChatComponent> chatter)+
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)
+
+ This method will try to look up an ItemBlock for given block and meta from s and place it at given
+ location.
+ This method assume block at given coord is NOT acceptable, but may or may not be trivially replaceable
+ This method might yield error messages to the player only if there is likely a programming error or exploit.
+ This method might yield error messages to the chatter.
s - drain resources from this placeactor - source of action. cannot be null.chatter - normal error destination. can be null to suppress them.public static IStructureElement.PlaceResult survivalPlaceBlock(Block block, + int meta, + World world, + int x, + int y, + int z, + IItemSource s, + EntityPlayer actor, + Consumer<IChatComponent> chatter)+
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)
+
+ This method will try to look up an ItemBlock for given block and meta from s and place it at given
+ location.
+ This method assume block at given coord is NOT acceptable, but may or may not be trivially replaceable
+ This method might yield error messages to the player only if there is likely a programming error or exploit.
+ This method might yield error messages to the chatter.
s - drain resources from this placeactor - source of action. cannot be null.chatter - normal error destination. can be null to suppress them.public static IStructureElement.PlaceResult survivalPlaceBlock(ItemStack stack, + ItemStackPredicate.NBTMode nbtMode, + NBTTagCompound tag, + boolean assumeStackPresent, + World world, + int x, + int y, + int z, + IItemSource s, + EntityPlayerMP actor)+
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)
+
+ This method will try to look up an ItemBlock for given block and meta from s and place it at given
+ location.
+ This method assume block at given coord is NOT acceptable, but may or may not be trivially replaceable
+ This method might yield error messages to the player only if there is likely a programming error or exploit.
stack - a valid stack with stack size of exactly 1. Must be of an ItemBlock!s - drain resources from this placeactor - source of action. cannot be null.public static IStructureElement.PlaceResult survivalPlaceBlock(ItemStack stack, + ItemStackPredicate.NBTMode nbtMode, + NBTTagCompound tag, + boolean assumeStackPresent, + World world, + int x, + int y, + int z, + IItemSource s, + EntityPlayer actor)+
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)
+
+ This method will try to look up an ItemBlock for given block and meta from s and place it at given
+ location.
+ This method assume block at given coord is NOT acceptable, but may or may not be trivially replaceable
+ This method might yield error messages to the player only if there is likely a programming error or exploit.
stack - a valid stack with stack size of exactly 1. Must be of an ItemBlock!s - drain resources from this placeactor - source of action. cannot be null.public static IStructureElement.PlaceResult survivalPlaceBlock(ItemStack stack, + ItemStackPredicate.NBTMode nbtMode, + NBTTagCompound tag, + boolean assumeStackPresent, + World world, + int x, + int y, + int z, + IItemSource s, + EntityPlayerMP actor, + @Nullable + Consumer<IChatComponent> chatter)+
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)
+
+ This method will try to look up an ItemBlock for given block and meta from s and place it at given
+ location.
+ This method assume block at given coord is NOT acceptable, but may or may not be trivially replaceable
+ This method might yield error messages to the player only if there is likely a programming error or exploit.
+ This method might yield error messages to the chatter.
stack - a valid stack with stack size of exactly 1. Must be of an ItemBlock!s - drain resources from this placeactor - source of action. cannot be null.chatter - normal error destination. can be null to suppress them.public static IStructureElement.PlaceResult survivalPlaceBlock(ItemStack stack, + ItemStackPredicate.NBTMode nbtMode, + NBTTagCompound tag, + boolean assumeStackPresent, + World world, + int x, + int y, + int z, + IItemSource s, + EntityPlayer actor, + @Nullable + Consumer<IChatComponent> chatter)+
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)
+
+ This method will try to look up an ItemBlock for given block and meta from s and place it at given
+ location.
+ This method assume block at given coord is NOT acceptable, but may or may not be trivially replaceable
+ This method might yield error messages to the player only if there is likely a programming error or exploit.
+ This method might yield error messages to the chatter.
stack - a valid stack with stack size of exactly 1. Must be of an ItemBlock!s - drain resources from this placeactor - source of action. cannot be null.chatter - normal error destination. can be null to suppress them.public static <T> IStructureElement<T> isAir()+
- in shape to automatically use this.
+ Provided nontheless in case you want this as a fallback to something else.public static <T> IStructureElement<T> notAir()+
+ in shape to automatically use this.
+ Provided nontheless in case you want this as a fallback to something else.public static <T> IStructureElement<T> error()+
public static <T> IStructureElementNoPlacement<T> ofHint(int dots)+
ofBlockUnlocalizedName(String, String, int, IStructureElement)public static <T> IStructureElementNoPlacement<T> ofHintDeferred(Supplier<IIcon[]> icons)+
ofBlockUnlocalizedName(String, String, int, IStructureElement)public static <T> IStructureElementNoPlacement<T> ofHintDeferred(Supplier<IIcon[]> icons, + short[] RGBa)+
ofBlockUnlocalizedName(String, String, int, IStructureElement)public static <T,TIER> IStructureElementCheckOnly<T> ofBlocksTiered(ITierConverter<TIER> tierExtractor, + @Nullable + TIER notSet, + BiConsumer<T,TIER> setter, + Function<T,TIER> getter)+
ofBlocksTiered(ITierConverter, List, Object, BiConsumer, Function)
+ Main difference is this one is check only.
+ + Note that if tierExtractor returns a null, this block will be rejected immediately. This makes null a potent + candidate for notSet. +
+ See documentation on the other overload for more information.
public static <T,TIER> IStructureElement<T> ofBlocksTiered(ITierConverter<TIER> tierExtractor, + @Nullable + List<org.apache.commons.lang3.tuple.Pair<Block,Integer>> allKnownTiers, + @Nullable + TIER notSet, + BiConsumer<T,TIER> setter, + Function<T,TIER> getter)+
+ (*): Implementation wise, this structure element will only accept a block if its tier is the same as existing tier or + if existing tier is unset (i.e. value of third argument) +
+ Above all else, you need to decide what tier you are going to use. For simpler cases, Integer is a good choice.
+ You can also use an existing Enum. Tier can never be null though.
+ It can also be a String or a ResourceLocation, or basically anything.
+ It doesn't even have to implement Comparable.
+
+ This assumes you will reset the backing storage, and on the first occurrence getter would return notSet.
+ You can also make getter to return other value to forcefully select a certain tier, but you're probably better
+ off using block adders or ofBlock(Block, int, Block, int) and its overloads
+
+ Implementation wise, this allows a block only when we don't yet have a tier, or the block at that location has + the same tier as we already have. +
+ There is yet no TileEntity counterpart of this utility. Feel free to submit a PR to add it. +
+ For most typical use cases, you will NOT want to return notSet from your tierExtractor. If you do so, we will + have this kind of chain of events: +
+ Example: +
+ Assume you have 16 tier, each map to one block's 16 different meta. You will usually want something like this +
+ public class Tile extends TileEntity {
+ private static final Block B = getTargetBlock();
+ private static final IStructureDefinition<Tile> S = IStructureDefinition.<Tile>builder()
+ // ... addShape, and other elements
+ .addElement('c', ofBlocksTiered((b, m) -> b == B ? m : null,
+ IntStream.range(0, 16).mapToObj(i -> Pair.of(B, i)).collect(Collectors.toList()),
+ -1,
+ (t, m) -> t.tier = m,
+ t -> t.tier))
+ .build();
+ private int tier;
+
+ public boolean check() {
+ tier = -1;
+ if (!S.check(...))
+ return false;
+ return isTierAcceptable(tier);
+ }
+ }
+ tierExtractor - a function to extract tier info from a block.
+ This function can return null and will never be passed a null block or an invalid block meta.allKnownTiers - A list of all known tiers as of calling. Can be empty or null. No hint will be spawned if empty or null. Cannot have null elements.
+ First element denotes the most primitive tier. Last element denotes the most advanced tier.
+ If not all tiers are available at definition construction time, use lazy(Supplier) or its overloads to delay a bit.
+ This list is only for hint particle spawning and survival build.
+ The hint/autoplace code will choose 1st pair to spawn/place if trigger item has master channel data of 1,
+ 2nd pair if 2, and so on.notSet - The value returned from getter when there were no tier info found in T yet. Can be null.getter - a function to retrieve the current tier from context objectsetter - a function to set the current tier into context objectpublic static <T> IStructureElement<T> ofBlockUnlocalizedName(String modid, + String unlocalizedName, + int meta)+
+ DUE TO HISTORICAL REASONS, THIS WAS CALLED ofBlockUnlocalizedName, BUT IT ACTUALLY USES REGISTRY NAME INSTEAD. +
+ While no immediate error will be thrown, client code should ensure said mod is loaded and + said mod is present, otherwise bad things will happen later!
public static <T> IStructureElement<T> ofBlockUnlocalizedName(String modid, + String registryName, + int meta, + boolean wildcard)+
+ DUE TO HISTORICAL REASONS, THIS WAS CALLED ofBlockUnlocalizedName, BUT IT ACTUALLY USES REGISTRY NAME INSTEAD. +
+ While no immediate error will be thrown, client code should ensure said mod is loaded and
+ said mod is present, otherwise the element will effectively become an error().
+
+ Will place block or hint using the given meta if wildcard is true.
public static <T> IStructureElement<T> ofBlockUnlocalizedName(String modid, + String unlocalizedName, + int meta, + IStructureElement<T> fallback)+
+ DUE TO HISTORICAL REASONS, THIS WAS CALLED ofBlockUnlocalizedName, BUT IT ACTUALLY USES REGISTRY NAME INSTEAD. +
+ This is slightly different to using the other overload and another element in a ofChain(IStructureElement[]).
+ Here fallback will only ever be used if this fails, where ofChain would form an OR relationship even if the mod
+ is loaded and the block exists in registry.
public static <T> IStructureElementNoPlacement<T> ofBlocksFlatHint(Map<Block,Integer> blocsMap, + Block hintBlock, + int hintMeta)+
ofBlocksMapHint(Map, Block, int) when for any accepted
+ block type we accept only one meta for each.
+ + Does not have autoplace.
blocsMap - Accepted (block, meta) pairs.hintBlock - hint block to usehintMeta - hint meta to useofBlocksMapHint(Map, Block, int)public static <T> IStructureElementNoPlacement<T> ofBlocksMapHint(Map<Block,Collection<Integer>> blocsMap, + Block hintBlock, + int hintMeta)+
+ Does not have autoplace.
blocsMap - Accepted (block, meta) pairs.hintBlock - hint block to usehintMeta - hint meta to useofBlocksFlatHint(Map, Block, int)public static <T> IStructureElementNoPlacement<T> ofBlockHint(Block block, + int meta, + Block hintBlock, + int hintMeta)+
public static <T> IStructureElementNoPlacement<T> ofBlockHint(Block block, + int meta)+
ofBlock(Block, int), except it explicitly turns off creative/survival
+ build.public static <T> IStructureElementNoPlacement<T> ofBlockAdderHint(IBlockAdder<T> iBlockAdder, + Block hintBlock, + int hintMeta)+
+ Useful when your logic is very complex. Does not support autoplace.
public static <T> IStructureElement<T> ofBlocksFlat(Map<Block,Integer> blocsMap, + Block defaultBlock, + int defaultMeta)+
ofBlocksMap(Map, Block, int) when for any accepted
+ block type we accept only one meta for each.blocsMap - Accepted (block, meta) pairs.defaultBlock - default block to place/spawn hintdefaultMeta - default meta to place/spawn hintofBlocksMapHint(Map, Block, int)public static <T> IStructureElement<T> ofBlocksMap(Map<Block,Collection<Integer>> blocsMap, + Block defaultBlock, + int defaultMeta)+
blocsMap - Accepted (block, meta) pairs.defaultBlock - default block to place/spawn hintdefaultMeta - default meta to place/spawn hintofBlocksMapHint(Map, Block, int)public static <T> IStructureElement<T> ofBlock(Block block, + int meta, + Block defaultBlock, + int defaultMeta)+
block - accepted blockmeta - accepted metadefaultBlock - hint blockdefaultMeta - hint metapublic static <T> IStructureElement<T> ofBlockAnyMeta(Block block, + Block defaultBlock, + int defaultMeta)+
ofBlock(Block, int, Block, int) but ignores target meta idpublic static <T> IStructureElement<T> ofBlock(Block block, + int meta)+
public static <T> IStructureElement<T> ofBlockAnyMeta(Block block)+
public static <T> IStructureElement<T> ofBlockAnyMeta(Block block, + int defaultMeta)+
public static <T> IStructureElement<T> ofBlockAdder(IBlockAdder<T> iBlockAdder, + Block defaultBlock, + int defaultMeta)+
+ Useful when your logic is very complex.
public static <T> IStructureElement<T> ofBlockAdder(IBlockAdder<T> iBlockAdder, + int dots)+
public static <T> IStructureElementNoPlacement<T> ofTileAdder(ITileAdder<T> iTileAdder, + Block hintBlock, + int hintMeta)+
public static <T,E> IStructureElementNoPlacement<T> ofSpecificTileAdder(BiPredicate<T,E> iTileAdder, + Class<E> tileClass, + Block hintBlock, + int hintMeta)+
public static <B extends IStructureElement<T>,T> IStructureElement<T> onElementPass(Consumer<T> onCheckPass, + B element)+
onCheckPass - side effectelement - downstreampublic static <B extends IStructureElement<T>,T> IStructureElement<T> onElementFail(Consumer<T> onFail, + B element)+
onFail - side effectelement - downstreampublic static <T> IStructureElement<T> onlyIf(Predicate<? super T> predicate, + IStructureElement<? super T> downstream)+
+ Return SKIP when survival auto place if given predicate returns false.
public static <T> IStructureElement<T> onlyIf(Predicate<? super T> predicate, + IStructureElement<? super T> downstream, + IStructureElement.PlaceResult placeResultWhenDisabled)+
placeResultWhenDisabled - value to return for survival auto place when predicate returns false@SafeVarargs +public static <T> IStructureElementChain<T> ofChain(IStructureElement<T>... elementChain)+
IStructureElement to form a OR chain.
+ As with any other OR operator, this one exhibits short-circuiting behavior, i.e. it will not call next structure element
+ if previous one succeeded. (*)
+
+ This allows you e.g. accept both a glass block using ofBlock(Block, int, Block, int) and a piece of air
+ using isAir().
+ It will not attempt to capture any errors though, so next one will not be tried if previous one would crash.
+
+ (*): For survival auto place, it will + * REJECT, if all structure element REJECT + * SKIP, if 1 or more structure element SKIP and the rest structure element (0 or more) REJECT + * any other result, **immediately** upon any structure element returns these other results. + This behavior is not 100% fixed and might change later on, but we will send the notice on a best effort basis. +
+ Take care while chaining, as it will try to call every structure element until it returns true. + If none does it will finally return false.
public static <T> IStructureElementChain<T> ofChain(List<IStructureElement<T>> elementChain)+
IStructureElement to form a OR chain.
+ + Practically no difference with the other overload.
ofChain(IStructureElement[])public static <CTX,T extends IWithExtendedContext<CTX>> IStructureElement<T> withContext(IStructureElement<CTX> elem)+
CTX - extended context typeT - existing context object typeelem - downstream elementpublic static <T> IStructureElementDeferred<T> lazy(Supplier<IStructureElement<T>> to)+
public static <T> IStructureElementDeferred<T> lazy(Function<T,IStructureElement<T>> to)+
+ Similar to defer, but caches the first returned element returned and won't call it again. + Initialization is not thread safe. + This will allow the structure element constructor to access properties only present on the context object + (e.g. GT5 multiblock controller), e.g. hatch texture index to use. + Use this if the data you access will remain constant.
to - create structure element from the first context object passed inpublic static <T> IStructureElementDeferred<T> defer(Supplier<IStructureElement<T>> to)+
lazy(Supplier) is enough will not break anything, but would incur unnecessary
+ performance overhead.to - downstream element supplierpublic static <T> IStructureElementDeferred<T> defer(Function<T,IStructureElement<T>> to)+
lazy(Supplier) is enough will not break anything, but would incur unnecessary
+ performance overhead.to - downstream element supplier@Deprecated +public static <T,K> IStructureElementDeferred<T> defer(Function<T,K> keyExtractor, + Map<K,IStructureElement<T>> map)+
+ This allows you to extract or compute a key from context object, and lookup a map for actual structure element + to use.
keyExtractor - extract a key from the context objectmap - all possible structure elementpublic static <T,K> IStructureElementDeferred<T> partitionBy(Function<T,K> keyExtractor, + Map<K,IStructureElement<T>> map)+
+ This allows you to extract or compute a key from context object, and lookup a map for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns a key + not found in map. +
+ Do pay attention to what properties your map has though. You need to pay attention to how they consider equality + and how they consider null key/values. Guava ImmutableMap is usually a good enough choice.
keyExtractor - extract a key from the context objectmap - all possible structure element@Deprecated +public static <T,K> IStructureElementDeferred<T> defer(Function<T,K> keyExtractor, + Map<K,IStructureElement<T>> map, + IStructureElement<T> defaultElem)+
+ This allows you to extract or compute a key from context object, and lookup a map for actual structure element
+ to use. The fallback will only be used when keyExtractor returns a value not found in given map. This will play
+ nicely in combination with error()
+
+ Do pay attention to what properties your map has though. You need to pay attention to how they consider equality + and how they consider null key/values. Guava ImmutableMap is usually a good enough choice.
keyExtractor - extract a key from the context objectmap - all possible structure elementdefaultElem - element to use when keyExtractor returns a value not found in given mappublic static <T,K> IStructureElementDeferred<T> partitionBy(Function<T,K> keyExtractor, + Map<K,IStructureElement<T>> map, + IStructureElement<T> defaultElem)+
+ This allows you to extract or compute a key from context object, and lookup a map for actual structure element
+ to use. The fallback will only be used when keyExtractor returns a value not found in given map. This will play
+ nicely in combination with error()
+
+ Do pay attention to what properties your map has though. You need to pay attention to how they consider equality + and how they consider null key/values. Guava ImmutableMap is usually a good enough choice.
keyExtractor - extract a key from the context objectmap - all possible structure elementdefaultElem - element to use when keyExtractor returns a value not found in given map@SafeVarargs + @Deprecated +public static <T> IStructureElementDeferred<T> defer(Function<T,Integer> keyExtractor, + IStructureElement<T>... array)+
+ This allows you to extract or compute an index from context object, and lookup an array for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns an index + not within the array bound +
+ Do pay place null values in the array.
keyExtractor - extract an index from the context objectarray - all possible structure element@SafeVarargs +public static <T> IStructureElementDeferred<T> partitionBy(Function<T,Integer> keyExtractor, + IStructureElement<T>... array)+
+ This allows you to extract or compute an index from context object, and lookup an array for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns an index + not within the array bound +
+ Do pay place null values in the array.
keyExtractor - extract an index from the context objectarray - all possible structure element@Deprecated +public static <T> IStructureElementDeferred<T> defer(Function<T,Integer> keyExtractor, + List<IStructureElement<T>> array)+
+ This allows you to extract or compute an index from context object, and lookup an array for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns an index + not within the array bound +
+ Do pay place null values in the array.
keyExtractor - extract an index from the context objectarray - all possible structure elementpublic static <T> IStructureElementDeferred<T> partitionBy(Function<T,Integer> keyExtractor, + List<IStructureElement<T>> array)+
+ This allows you to extract or compute an index from context object, and lookup an array for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns an index + not within the array bound +
+ Do pay place null values in the array.
keyExtractor - extract an index from the context objectarray - all possible structure elementpublic static <T> IStructureElementDeferred<T> defer(BiFunction<T,ItemStack,IStructureElement<T>> to)+
lazy(Supplier) is enough will not break anything, but would incur unnecessary
+ performance overhead.
+ + This variant also passes the trigger item to the function, allowing it to get more info.
to - downstream element supplier@Deprecated +public static <T,K> IStructureElementDeferred<T> defer(BiFunction<T,ItemStack,K> keyExtractor, + Map<K,IStructureElement<T>> map)+
+ This allows you to extract or compute a key from context object, and lookup a map for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns a key + not found in map. +
+ Do pay attention to what properties your map has though. You need to pay attention to how they consider equality + and how they consider null key/values. Guava ImmutableMap is usually a good enough choice. +
+ This variant also passes the trigger item to the function, allowing it to get more info.
keyExtractor - extract a key from the context object and trigger itemmap - all possible structure elementpublic static <T,K> IStructureElementDeferred<T> partitionBy(BiFunction<T,ItemStack,K> keyExtractor, + Map<K,IStructureElement<T>> map)+
+ This allows you to extract or compute a key from context object, and lookup a map for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns a key + not found in map. +
+ Do pay attention to what properties your map has though. You need to pay attention to how they consider equality + and how they consider null key/values. Guava ImmutableMap is usually a good enough choice. +
+ This variant also passes the trigger item to the function, allowing it to get more info.
keyExtractor - extract a key from the context object and trigger itemmap - all possible structure element@Deprecated +public static <T,K> IStructureElementDeferred<T> defer(BiFunction<T,ItemStack,K> keyExtractor, + Map<K,IStructureElement<T>> map, + IStructureElement<T> defaultElem)+
+ This allows you to extract or compute a key from context object, and lookup a map for actual structure element
+ to use. The fallback will only be used when keyExtractor returns a value not found in given map. This will play
+ nicely in combination with error()
+
+ Do pay attention to what properties your map has though. You need to pay attention to how they consider equality + and how they consider null key/values. Guava ImmutableMap is usually a good enough choice. +
+ This variant also passes the trigger item to the function, allowing it to get more info.
keyExtractor - extract a key from the context object and trigger itemmap - all possible structure elementdefaultElem - element to use when keyExtractor returns a value not found in given mappublic static <T,K> IStructureElementDeferred<T> partitionBy(BiFunction<T,ItemStack,K> keyExtractor, + Map<K,IStructureElement<T>> map, + IStructureElement<T> defaultElem)+
+ This allows you to extract or compute a key from context object, and lookup a map for actual structure element
+ to use. The fallback will only be used when keyExtractor returns a value not found in given map. This will play
+ nicely in combination with error()
+
+ Do pay attention to what properties your map has though. You need to pay attention to how they consider equality + and how they consider null key/values. Guava ImmutableMap is usually a good enough choice. +
+ This variant also passes the trigger item to the function, allowing it to get more info.
keyExtractor - extract a key from the context object and trigger itemmap - all possible structure elementdefaultElem - element to use when keyExtractor returns a value not found in given map@SafeVarargs +public static <T> IStructureElementDeferred<T> defer(BiFunction<T,ItemStack,Integer> keyExtractor, + IStructureElement<T>... array)+
+ This allows you to extract or compute an index from context object, and lookup an array for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns an index + not within the array bound +
+ Do pay place null values in the array. +
+ This variant also passes the trigger item to the function, allowing it to get more info.
keyExtractor - extract a key from the context object and trigger itemarray - all possible structure elementpublic static <T> IStructureElementDeferred<T> defer(BiFunction<T,ItemStack,Integer> keyExtractor, + List<IStructureElement<T>> array)+
+ This allows you to extract or compute an index from context object, and lookup an array for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns an index + not within the array bound +
+ Do pay place null values in the array. +
+ This variant also passes the trigger item to the function, allowing it to get more info.
keyExtractor - extract a key from the context object and trigger itemarray - all possible structure elementpublic static <T> IStructureElementDeferred<T> defer(Function<T,IStructureElement<T>> toCheck, + BiFunction<T,ItemStack,IStructureElement<T>> to)+
+ Similar to defer, but caches the first returned element returned and won't call it again. + Initialization is not thread safe. + This will allow the structure element constructor to access properties only present on the context object + (e.g. GT5 multiblock controller), e.g. hatch texture index to use. + Use this if the data you access will remain constant. +
+ This variant will override the check function of the structure element from second function with the one returned + from the structure element from first function.
toCheck - override the check function with the returned elementto - create structure element from the context object passed in@Deprecated +public static <T,K> IStructureElementDeferred<T> defer(Function<T,K> keyExtractorCheck, + BiFunction<T,ItemStack,K> keyExtractor, + Map<K,IStructureElement<T>> map)+
+ This allows you to extract or compute a key from context object, and lookup a map for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns a key + not found in map. +
+ Do pay attention to what properties your map has though. You need to pay attention to how they consider equality + and how they consider null key/values. Guava ImmutableMap is usually a good enough choice. +
+ This variant also passes the trigger item to the function, allowing it to get more info. +
+ This variant will override the check function of the structure element from second function with the one returned + from the structure element from first function.
keyExtractorCheck - key extractor of the structure element that will be used for check.keyExtractor - extract a key from the context object and trigger itemmap - all possible structure elementpublic static <T,K> IStructureElementDeferred<T> partitionBy(Function<T,K> keyExtractorCheck, + BiFunction<T,ItemStack,K> keyExtractor, + Map<K,IStructureElement<T>> map)+
+ This allows you to extract or compute a key from context object, and lookup a map for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns a key + not found in map. +
+ Do pay attention to what properties your map has though. You need to pay attention to how they consider equality + and how they consider null key/values. Guava ImmutableMap is usually a good enough choice. +
+ This variant also passes the trigger item to the function, allowing it to get more info. +
+ This variant will override the check function of the structure element from second function with the one returned + from the structure element from first function.
keyExtractorCheck - key extractor of the structure element that will be used for check.keyExtractor - extract a key from the context object and trigger itemmap - all possible structure element@Deprecated +public static <T,K> IStructureElementDeferred<T> defer(Function<T,K> keyExtractorCheck, + BiFunction<T,ItemStack,K> keyExtractor, + Map<K,IStructureElement<T>> map, + IStructureElement<T> defaultElem)+
+ This allows you to extract or compute a key from context object, and lookup a map for actual structure element + to use. defaultElem will be used if either extractor returned a key not found in map. +
+ Do pay attention to what properties your map has though. You need to pay attention to how they consider equality + and how they consider null key/values. Guava ImmutableMap is usually a good enough choice. +
+ This variant also passes the trigger item to the function, allowing it to get more info. +
+ This variant will override the check function of the structure element from second function with the one returned + from the structure element from first function.
keyExtractorCheck - key extractor of the structure element that will be used for check.keyExtractor - extract a key from the context object and trigger itemmap - all possible structure elementpublic static <T,K> IStructureElementDeferred<T> partitionBy(Function<T,K> keyExtractorCheck, + BiFunction<T,ItemStack,K> keyExtractor, + Map<K,IStructureElement<T>> map, + IStructureElement<T> defaultElem)+
+ This allows you to extract or compute a key from context object, and lookup a map for actual structure element + to use. defaultElem will be used if either extractor returned a key not found in map. +
+ Do pay attention to what properties your map has though. You need to pay attention to how they consider equality + and how they consider null key/values. Guava ImmutableMap is usually a good enough choice. +
+ This variant also passes the trigger item to the function, allowing it to get more info. +
+ This variant will override the check function of the structure element from second function with the one returned + from the structure element from first function.
keyExtractorCheck - key extractor of the structure element that will be used for check.keyExtractor - extract a key from the context object and trigger itemmap - all possible structure element@SafeVarargs + @Deprecated +public static <T> IStructureElementDeferred<T> defer(Function<T,Integer> keyExtractorCheck, + BiFunction<T,ItemStack,Integer> keyExtractor, + IStructureElement<T>... array)+
+ This allows you to extract or compute an index from context object, and lookup an array for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns an index + not within the array bound +
+ Do pay place null values in the array. +
+ This variant also passes the trigger item to the function, allowing it to get more info. +
+ This variant will override the check function of the structure element from second function with the one returned + from the structure element from first function.
keyExtractorCheck - key extractor of the structure element that will be used for check.keyExtractor - extract a key from the context object and trigger itemarray - all possible structure element@SafeVarargs +public static <T> IStructureElementDeferred<T> partitionBy(Function<T,Integer> keyExtractorCheck, + BiFunction<T,ItemStack,Integer> keyExtractor, + IStructureElement<T>... array)+
+ This allows you to extract or compute an index from context object, and lookup an array for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns an index + not within the array bound +
+ Do pay place null values in the array. +
+ This variant also passes the trigger item to the function, allowing it to get more info. +
+ This variant will override the check function of the structure element from second function with the one returned + from the structure element from first function.
keyExtractorCheck - key extractor of the structure element that will be used for check.keyExtractor - extract a key from the context object and trigger itemarray - all possible structure element@Deprecated +public static <T> IStructureElementDeferred<T> defer(Function<T,Integer> keyExtractorCheck, + BiFunction<T,ItemStack,Integer> keyExtractor, + List<IStructureElement<T>> array)+
+ This allows you to extract or compute an index from context object, and lookup an array for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns an index + not within the array bound +
+ This variant also passes the trigger item to the function, allowing it to get more info. +
+ This variant will override the check function of the structure element from second function with the one returned + from the structure element from first function.
keyExtractorCheck - key extractor of the structure element that will be used for check.keyExtractor - extract a key from the context object and trigger itemarray - all possible structure elementpublic static <T> IStructureElementDeferred<T> partitionBy(Function<T,Integer> keyExtractorCheck, + BiFunction<T,ItemStack,Integer> keyExtractor, + List<IStructureElement<T>> array)+
+ This allows you to extract or compute an index from context object, and lookup an array for actual structure element + to use. This will usually, but not guaranteed, to throw an exception at runtime if keyExtractor returns an index + not within the array bound +
+ This variant also passes the trigger item to the function, allowing it to get more info. +
+ This variant will override the check function of the structure element from second function with the one returned + from the structure element from first function.
keyExtractorCheck - key extractor of the structure element that will be used for check.keyExtractor - extract a key from the context object and trigger itemarray - all possible structure elementpublic static <T> IStructureElement<T> withChannel(String channel, + IStructureElement<T> backing)+
public static <T> com.gtnewhorizon.structurelib.structure.IStructureNavigate<T> step(int a, + int b, + int c)+
public static <T> com.gtnewhorizon.structurelib.structure.IStructureNavigate<T> step(Vec3Impl step)+
public static String getPseudoJavaCode(World world, + ExtendedFacing extendedFacing, + int basePositionX, + int basePositionY, + int basePositionZ, + int basePositionA, + int basePositionB, + int basePositionC, + Function<? super TileEntity,String> tileEntityClassifier, + int sizeA, + int sizeB, + int sizeC, + boolean transpose)+
+ NOTE: GT specific code got removed. TODO add a mean
tileEntityClassifier - return a string that denote the type of a tile entity, or null if it's nothing special. useful if the tile entity cannot be simply distinguished via getClass.public static void iterate(World world, + ExtendedFacing extendedFacing, + int basePositionX, + int basePositionY, + int basePositionZ, + int basePositionA, + int basePositionB, + int basePositionC, + int sizeA, + int sizeB, + int sizeC, + IBlockPosConsumer iBlockPosConsumer)+
public static void iterate(World world, + ExtendedFacing extendedFacing, + int basePositionX, + int basePositionY, + int basePositionZ, + int basePositionA, + int basePositionB, + int basePositionC, + boolean transpose, + int sizeA, + int sizeB, + int sizeC, + IBlockPosConsumer iBlockPosConsumer, + Runnable nextB, + Runnable nextC)+
public static String[][] transpose(String[][] structurePiece)+
structurePiece - shape (transposed shape)public interface IBlockAdder<T>
+| Modifier and Type | +Method and Description | +
|---|---|
boolean |
+apply(T t,
+ Block block,
+ int meta)
+Callback on block added, needs to check if block is valid (and add it)
+ |
+
public interface ITileAdder<T>
+| Modifier and Type | +Method and Description | +
|---|---|
boolean |
+apply(T t,
+ TileEntity tileEntity)
+Callback to add hatch, needs to check if tile is valid (and add it)
+ |
+
boolean apply(T t, + TileEntity tileEntity)+
tileEntity - tileSee: Description
+| Interface | +Description | +
|---|---|
| IBlockAdder<T> | ++ |
| ITileAdder<T> | ++ |
See: Description
+| Interface | +Description | +
|---|---|
| IBlockPosConsumer | ++ |
| ICustomBlockSetting | ++ |
| IItemSource | +
+ Represent an item source.
+ |
+
| ISpecialItemBlock | ++ |
| IStructureDefinition<T> | +
+ This is the structure definition of your multi.
+ |
+
| IStructureElement<T> | +
+ Use StructureUtility to instantiate.
+ |
+
| IStructureElementChain<T> | +
+ Use StructureUtility to instantiate
+ |
+
| IStructureElementCheckOnly<T> | ++ |
| IStructureElementDeferred<T> | +
+ Use StructureUtility to instantiate
+ |
+
| IStructureElementNoPlacement<T> | ++ |
| ISurvivalBuildEnvironment | ++ |
| ITierConverter<TIER> | +
+ a function to extract tier info from a block.
+ |
+
| IWithExtendedContext<CTX> | +
+ Implement this and use
+StructureUtility.withContext(IStructureElement) in case you need to record some
+ temporary states that don't need to live in your main context, which would usually live for the whole lifetime of the
+ structure than just during structure check. |
+
| Class | +Description | +
|---|---|
| AutoPlaceEnvironment | +
+ Represent the environment in which autoplace of a single element took place.
+ |
+
| IStructureElement.BlocksToPlace | ++ |
| StructureDefinition<T> | ++ |
| StructureDefinition.Builder<T> | ++ |
| StructureUtility | +
+ A brief index of everything contained
+ |
+
| Enum | +Description | +
|---|---|
| AutoPlaceEnvironment.APILevel | +
+ Defines the various API level an
+AutoPlaceEnvironment has implemented. |
+
| IStructureElement.PlaceResult | ++ |
+ All public stuff in this package and its subpackages are considered part of the public API. + Backwards compatibility is maintained to the maximum extend possible.
| Constructor and Description | +
|---|
InventoryIterable(Inv inv) |
+
| Modifier and Type | +Method and Description | +
|---|---|
Inv |
+getInventory() |
+
Iterator<ItemStack> |
+iterator() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static interface InventoryUtility.InventoryProvider<R extends Iterable<ItemStack>>
+| Modifier and Type | +Method and Description | +
|---|---|
R |
+getInventory(EntityPlayerMP player) |
+
void |
+markDirty(R inv) |
+
public static interface InventoryUtility.ItemStackCounter
+| Modifier and Type | +Method and Description | +
|---|---|
void |
+add(ItemStack stack,
+ int stackSize)
+Add some amount of stack.
+ |
+
public static enum InventoryUtility.ItemStackExtractor.APIType +extends Enum<InventoryUtility.ItemStackExtractor.APIType>+
| Enum Constant and Description | +
|---|
EXTRACT_ONE_STACK |
+
MAIN |
+
| Modifier and Type | +Method and Description | +
|---|---|
static InventoryUtility.ItemStackExtractor.APIType |
+valueOf(String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static InventoryUtility.ItemStackExtractor.APIType[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
public static final InventoryUtility.ItemStackExtractor.APIType MAIN+
public static final InventoryUtility.ItemStackExtractor.APIType EXTRACT_ONE_STACK+
public static InventoryUtility.ItemStackExtractor.APIType[] values()+
+for (InventoryUtility.ItemStackExtractor.APIType c : InventoryUtility.ItemStackExtractor.APIType.values()) + System.out.println(c); +
public static InventoryUtility.ItemStackExtractor.APIType valueOf(String name)+
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static interface InventoryUtility.ItemStackExtractor
+| Modifier and Type | +Interface and Description | +
|---|---|
static class |
+InventoryUtility.ItemStackExtractor.APIType |
+
| Modifier and Type | +Method and Description | +
|---|---|
static InventoryUtility.ItemStackExtractor |
+createOnlyOptimized(InventoryUtility.OptimizedExtractor optimizedExtractor) |
+
default int |
+getItem(ItemStack source,
+ ItemStack toExtract,
+ boolean simulate,
+ EntityPlayerMP player)
+Extract a particular type of item.
+ |
+
boolean |
+isAPIImplemented(InventoryUtility.ItemStackExtractor.APIType type) |
+
int |
+takeFromStack(Predicate<ItemStack> predicate,
+ boolean simulate,
+ int count,
+ InventoryUtility.ItemStackCounter store,
+ ItemStack source,
+ ItemStack filter,
+ EntityPlayerMP player)
+Extract a particular type of item.
+ |
+
boolean isAPIImplemented(InventoryUtility.ItemStackExtractor.APIType type)+
int takeFromStack(Predicate<ItemStack> predicate, + boolean simulate, + int count, + InventoryUtility.ItemStackCounter store, + ItemStack source, + ItemStack filter, + EntityPlayerMP player)+
+ Whether this method does recursive extraction is at the discretion of implementor.
predicate - the main filtering predicate. never null. It's assumed predicate always returns true on filter,
+ if that is not nullstore - where to store extracted items. Should increment thesource - from where an extraction should be attemptedfilter - stack to extract. should not be mutated! match the NBT tag using EXACT mode. might be null.simulate - true if only query but does not actually removeplayer - executor of extraction, or null if from a machinedefault int getItem(ItemStack source, + ItemStack toExtract, + boolean simulate, + EntityPlayerMP player)+
+ Whether this method does recursive extraction is at the discretion of implementor.
source - from where an extraction should be attemptedtoExtract - stack to extract. should not be mutated! match the NBT tag using EXACT mode.simulate - true if only query but does not actually removeplayer - executor of extraction, or null if from a machinestatic InventoryUtility.ItemStackExtractor createOnlyOptimized(@Nonnull + InventoryUtility.OptimizedExtractor optimizedExtractor)+
public static interface InventoryUtility.OptimizedExtractor
+| Modifier and Type | +Method and Description | +
|---|---|
int |
+extract(ItemStack source,
+ ItemStack toExtract,
+ boolean simulate,
+ EntityPlayerMP player)
+Extract a particular type of item.
+ |
+
int extract(ItemStack source, + ItemStack toExtract, + boolean simulate, + EntityPlayerMP player)+
+ Whether optimized extractor do recursive extraction is at the discretion of implementor.
source - from where an extraction should be attemptedtoExtract - stack to extract. should not be mutated! match the NBT tag using EXACT mode.simulate - true if only query but does not actually removeplayer - executor of extraction, or null if from a machinepublic class InventoryUtility +extends Object+
| Modifier and Type | +Class and Description | +
|---|---|
static interface |
+InventoryUtility.InventoryProvider<R extends Iterable<ItemStack>> |
+
static interface |
+InventoryUtility.ItemStackCounter |
+
static interface |
+InventoryUtility.ItemStackExtractor |
+
static interface |
+InventoryUtility.OptimizedExtractor |
+
| Constructor and Description | +
|---|
InventoryUtility() |
+
| Modifier and Type | +Method and Description | +
|---|---|
static Iterator<? extends InventoryUtility.ItemStackExtractor> |
+getStackExtractors() |
+
static <Inv extends IInventory> |
+newInventoryProvider(Function<EntityPlayerMP,? extends Inv> extractor) |
+
static InventoryUtility.ItemStackExtractor |
+newItemStackProvider(Function<ItemStack,? extends IInventory> extractor) |
+
static void |
+registerEnableEnderCondition(Predicate<? super EntityPlayerMP> predicate) |
+
static <Inv extends IInventory> |
+registerInventoryProvider(String key,
+ Function<EntityPlayerMP,? extends Inv> extractor) |
+
static void |
+registerInventoryProvider(String key,
+ InventoryUtility.InventoryProvider<?> val) |
+
static <Inv extends IInventory> |
+registerStackExtractor(String key,
+ Function<ItemStack,? extends Inv> extractor) |
+
static void |
+registerStackExtractor(String key,
+ InventoryUtility.ItemStackExtractor val) |
+
static int |
+takeFromInventory(EntityPlayerMP player,
+ ItemStack filter,
+ boolean simulate)
+take count amount of stacks that matches given filter.
+ |
+
static Map<ItemStack,Integer> |
+takeFromInventory(EntityPlayerMP player,
+ Predicate<ItemStack> predicate,
+ boolean simulate,
+ int count)
+take count amount of stacks that matches given filter.
+ |
+
static Map<ItemStack,Integer> |
+takeFromInventory(Iterable<ItemStack> inv,
+ Predicate<ItemStack> predicate,
+ boolean simulate,
+ int count,
+ boolean recursive)
+take count amount of stacks that matches given filter.
+ |
+
public static void registerEnableEnderCondition(Predicate<? super EntityPlayerMP> predicate)+
public static void registerStackExtractor(String key, + InventoryUtility.ItemStackExtractor val)+
public static <Inv extends IInventory> void registerStackExtractor(String key, + Function<ItemStack,? extends Inv> extractor)+
public static void registerInventoryProvider(String key, + InventoryUtility.InventoryProvider<?> val)+
public static <Inv extends IInventory> void registerInventoryProvider(String key, + Function<EntityPlayerMP,? extends Inv> extractor)+
public static Iterator<? extends InventoryUtility.ItemStackExtractor> getStackExtractors()+
public static <Inv extends IInventory> InventoryUtility.InventoryProvider<InventoryIterable<Inv>> newInventoryProvider(Function<EntityPlayerMP,? extends Inv> extractor)+
public static InventoryUtility.ItemStackExtractor newItemStackProvider(Function<ItemStack,? extends IInventory> extractor)+
public static Map<ItemStack,Integer> takeFromInventory(EntityPlayerMP player, + Predicate<ItemStack> predicate, + boolean simulate, + int count)+
player - source of stackspredicate - item stack filtersimulate - whether to do removalcount - let's hope int size is enough...public static int takeFromInventory(EntityPlayerMP player, + ItemStack filter, + boolean simulate)+
player - source of stacksfilter - the precise type of item to extract. stackSize matterssimulate - whether to do removalpublic static Map<ItemStack,Integer> takeFromInventory(Iterable<ItemStack> inv, + Predicate<ItemStack> predicate, + boolean simulate, + int count, + boolean recursive)+
inv - source of stackspredicate - item stack filtersimulate - whether to do removalcount - let's hope int size is enough...recursive - do recursive lookup using stack extractors| Constructor and Description | +
|---|
ItemStackArrayIterable(ItemStack[] stacks) |
+
| Modifier and Type | +Method and Description | +
|---|---|
ItemStack[] |
+getStacks() |
+
Iterator<ItemStack> |
+iterator() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static enum ItemStackPredicate.NBTMode +extends Enum<ItemStackPredicate.NBTMode> +implements BiPredicate<NBTTagCompound,NBTTagCompound>+
| Enum Constant and Description | +
|---|
EXACT |
+
IGNORE |
+
IGNORE_KNOWN_INSIGNIFICANT_TAGS |
+
IN |
+
| Modifier and Type | +Method and Description | +
|---|---|
static ItemStackPredicate.NBTMode |
+valueOf(String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static ItemStackPredicate.NBTMode[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfpublic static final ItemStackPredicate.NBTMode IGNORE+
public static final ItemStackPredicate.NBTMode IN+
public static final ItemStackPredicate.NBTMode EXACT+
public static final ItemStackPredicate.NBTMode IGNORE_KNOWN_INSIGNIFICANT_TAGS+
public static ItemStackPredicate.NBTMode[] values()+
+for (ItemStackPredicate.NBTMode c : ItemStackPredicate.NBTMode.values()) + System.out.println(c); +
public static ItemStackPredicate.NBTMode valueOf(String name)+
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is null| Modifier and Type | +Class and Description | +
|---|---|
static class |
+ItemStackPredicate.NBTMode |
+
| Modifier and Type | +Method and Description | +
|---|---|
static ItemStackPredicate |
+from(Block block) |
+
static ItemStackPredicate |
+from(Item item) |
+
static ItemStackPredicate |
+from(ItemStack itemStack) |
+
static ItemStackPredicate |
+from(ItemStack itemStack,
+ ItemStackPredicate.NBTMode mode) |
+
ItemStackPredicate |
+ignoreMeta() |
+
ItemStackPredicate |
+setMeta(int meta) |
+
ItemStackPredicate |
+setTag(ItemStackPredicate.NBTMode mode,
+ NBTTagCompound tag) |
+
boolean |
+test(ItemStack itemStack) |
+
public static ItemStackPredicate from(Item item)+
public static ItemStackPredicate from(ItemStack itemStack)+
public static ItemStackPredicate from(ItemStack itemStack, + ItemStackPredicate.NBTMode mode)+
public static ItemStackPredicate from(Block block)+
public ItemStackPredicate ignoreMeta()+
public ItemStackPredicate setMeta(int meta)+
public ItemStackPredicate setTag(ItemStackPredicate.NBTMode mode, + NBTTagCompound tag)+
public class MiscUtils +extends Object+
| Modifier and Type | +Method and Description | +
|---|---|
static Set<String> |
+getTagKeys(NBTTagCompound tag) |
+
public static Set<String> getTagKeys(NBTTagCompound tag)+
| Constructor and Description | +
|---|
SortedRegistry() |
+
| Modifier and Type | +Method and Description | +
|---|---|
boolean |
+containsKey(String key) |
+
boolean |
+containsValue(V value) |
+
void |
+forEach(Consumer<? super V> action) |
+
V |
+get(String key) |
+
boolean |
+isEmpty() |
+
Iterator<V> |
+iterator() |
+
void |
+register(String key,
+ V val) |
+
int |
+size() |
+
Spliterator<V> |
+spliterator() |
+
public int size()+
public boolean isEmpty()+
public boolean containsKey(String key)+
public boolean containsValue(V value)+
public Spliterator<V> spliterator()+
spliterator in interface Iterable<V>public class Vec3Impl +extends Object +implements Comparable<Vec3Impl>+
| Modifier and Type | +Field and Description | +
|---|---|
static Vec3Impl |
+NULL_VECTOR |
+
| Constructor and Description | +
|---|
Vec3Impl(int in0,
+ int in1,
+ int in2) |
+
| Modifier and Type | +Method and Description | +
|---|---|
Vec3Impl |
+abs() |
+
Vec3Impl |
+add(int pos0,
+ int pos1,
+ int pos2) |
+
Vec3Impl |
+add(Vec3Impl pos) |
+
int |
+compareTo(Vec3Impl o) |
+
Vec3Impl |
+crossProduct(Vec3Impl vec) |
+
double |
+distanceSq(double x,
+ double y,
+ double z,
+ boolean useCenter) |
+
double |
+distanceSq(IPosition to,
+ boolean useCenter) |
+
double |
+distanceSq(Vec3Impl to) |
+
boolean |
+equals(Object o) |
+
int |
+get(int index)
+Gets the coordinate.
+ |
+
int |
+get0()
+Gets the X coordinate.
+ |
+
int |
+get1()
+Gets the Y coordinate.
+ |
+
int |
+get2()
+Gets the Z coordinate.
+ |
+
static Vec3Impl |
+getFromPool(int in0,
+ int in1,
+ int in2)
+THIS WILL CAUSE THIS VECTOR TO PERMANENTLY RESIDE IN STATIC MEMORY.
+ |
+
int |
+hashCode() |
+
int |
+manhattanDistance(Vec3Impl to) |
+
Vec3Impl |
+offset(net.minecraftforge.common.util.ForgeDirection facing,
+ int n) |
+
Vec3Impl |
+sub(int pos0,
+ int pos1,
+ int pos2) |
+
Vec3Impl |
+sub(Vec3Impl pos) |
+
String |
+toString() |
+
boolean |
+withinDistance(IPosition to,
+ double distance) |
+
boolean |
+withinDistance(Vec3Impl to,
+ double distance) |
+
public Vec3Impl(int in0, + int in1, + int in2)+
public static Vec3Impl getFromPool(int in0, + int in1, + int in2)+
public int compareTo(Vec3Impl o)+
compareTo in interface Comparable<Vec3Impl>public int get(int index)+
public int get0()+
public int get1()+
public int get2()+
public Vec3Impl offset(net.minecraftforge.common.util.ForgeDirection facing, + int n)+
public Vec3Impl add(int pos0, + int pos1, + int pos2)+
public Vec3Impl sub(int pos0, + int pos1, + int pos2)+
public boolean withinDistance(Vec3Impl to, + double distance)+
public boolean withinDistance(IPosition to, + double distance)+
public double distanceSq(Vec3Impl to)+
public double distanceSq(IPosition to, + boolean useCenter)+
public double distanceSq(double x, + double y, + double z, + boolean useCenter)+
public int manhattanDistance(Vec3Impl to)+
public Vec3Impl abs()+
public class XSTR +extends Random+
| Modifier and Type | +Field and Description | +
|---|---|
static XSTR |
+XSTR_INSTANCE |
+
| Constructor and Description | +
|---|
XSTR()
+Creates a new pseudo random number generator.
+ |
+
XSTR(long seed)
+Creates a new pseudo random number generator, starting with the specified
+ seed, using
+setSeed(seed);. |
+
| Modifier and Type | +Method and Description | +
|---|---|
XSTR |
+clone() |
+
long |
+getSeed()
+Returns the current state of the seed, can be used to clone the object
+ |
+
int |
+next(int nbits)
+Implementation of George Marsaglia's elegant Xorshift random generator
+ 30% faster and better quality than the built-in java.util.random see also
+ see http://www.javamex.com/tutorials/random_numbers/xorshift.shtml
+ |
+
boolean |
+nextBoolean() |
+
void |
+nextBytes(byte[] bytes_arr) |
+
double |
+nextDouble() |
+
float |
+nextFloat() |
+
double |
+nextGaussian() |
+
int |
+nextInt() |
+
int |
+nextInt(int bound)
+Returns a pseudorandom, uniformly distributed
+int value between 0
+ (inclusive) and the specified value (exclusive), drawn from this random
+ number generator's sequence. |
+
long |
+nextLong() |
+
void |
+setSeed(long seed)
+Sets the seed for this pseudo random number generator.
+ |
+
public XSTR()+
setSeed(System.currentTimeMillis());.public XSTR(long seed)+
setSeed(seed);.seed - the initial seedpublic boolean nextBoolean()+
nextBoolean in class Randompublic double nextDouble()+
nextDouble in class Randompublic long getSeed()+
public void setSeed(long seed)+
public XSTR clone()+ +
public int next(int nbits)+
public double nextGaussian()+
nextGaussian in class Randompublic int nextInt(int bound)+
int value between 0
+ (inclusive) and the specified value (exclusive), drawn from this random
+ number generator's sequence. The general contract of nextInt is
+ that one int value in the specified range is pseudorandomly
+ generated and returned. All bound possible int values are
+ produced with (approximately) equal probability. The method
+ nextInt(int bound) is implemented by class Random as if
+ by:
+
+ public int nextInt(int bound) {
+ if (bound <= 0)
+ throw new IllegalArgumentException("bound must be positive");
+
+ if ((bound & -bound) == bound) // i.e., bound is a power of 2
+ return (int)((bound * (long)next(31)) >> 31);
+
+ int bits, val;
+ do {
+ bits = next(31);
+ val = bits % bound;
+ } while (bits - val + (bound-1) < 0);
+ return val;
+ }
+
+ The hedge "approx
+ imately" is used in the foregoing description only because the next
+ method is only approximately an unbiased source of independently chosen
+ bits. If it were a perfect source of randomly chosen bits, then the
+ algorithm shown would choose int values from the stated range
+ with perfect uniformity.
+
+ The algorithm is slightly tricky. It rejects values that would result in + an uneven distribution (due to the fact that 2^31 is not divisible by n). + The probability of a value being rejected depends on n. The worst case is + n=2^30+1, for which the probability of a reject is 1/2, and the expected + number of iterations before the loop terminates is 2. +
+ The algorithm treats the case where n is a power of two specially: it + returns the correct number of high-order bits from the underlying + pseudo-random number generator. In the absence of special treatment, the + correct number of low-order bits would be returned. Linear + congruential pseudo-random number generators such as the one implemented + by this class are known to have short periods in the sequence of values + of their low-order bits. Thus, this special case greatly increases the + length of the sequence of values returned by successive calls to this + method if n is a small power of two.
nextInt in class Randombound - the upper bound (exclusive). Must be positive.int value
+ between zero (inclusive) and bound (exclusive) from this random
+ number generator's sequenceIllegalArgumentException - if bound is not positive| Interface | +Description | +
|---|---|
| InventoryUtility.InventoryProvider<R extends Iterable<ItemStack>> | ++ |
| InventoryUtility.ItemStackCounter | ++ |
| InventoryUtility.ItemStackExtractor | ++ |
| InventoryUtility.OptimizedExtractor | ++ |
| Class | +Description | +
|---|---|
| InventoryIterable<Inv extends IInventory> | ++ |
| InventoryUtility | +
+ This class is part of API, but is not stable.
+ |
+
| ItemStackArrayIterable | ++ |
| ItemStackPredicate | ++ |
| MiscUtils | +
+ not related to a certain mod!
+ |
+
| SortedRegistry<V> | ++ |
| Vec3Impl | ++ |
| XSTR | +
+ XSTR - Xorshift ThermiteRandom
+ Modified by Bogdan-G
+ 03.06.2016
+ version 0.0.4
+ |
+
| Enum | +Description | +
|---|---|
| InventoryUtility.ItemStackExtractor.APIType | ++ |
| ItemStackPredicate.NBTMode | ++ |
| Modifier and Type | +Constant Field | +Value | +
|---|---|---|
+
+public static final int |
+HINT_BLOCK_META_AIR |
+13 |
+
+
+public static final int |
+HINT_BLOCK_META_DEFAULT |
+12 |
+
+
+public static final int |
+HINT_BLOCK_META_ERROR |
+15 |
+
+
+public static final int |
+HINT_BLOCK_META_GENERIC_0 |
+0 |
+
+
+public static final int |
+HINT_BLOCK_META_GENERIC_1 |
+1 |
+
+
+public static final int |
+HINT_BLOCK_META_GENERIC_10 |
+10 |
+
+
+public static final int |
+HINT_BLOCK_META_GENERIC_11 |
+11 |
+
+
+public static final int |
+HINT_BLOCK_META_GENERIC_2 |
+2 |
+
+
+public static final int |
+HINT_BLOCK_META_GENERIC_3 |
+3 |
+
+
+public static final int |
+HINT_BLOCK_META_GENERIC_4 |
+4 |
+
+
+public static final int |
+HINT_BLOCK_META_GENERIC_5 |
+5 |
+
+
+public static final int |
+HINT_BLOCK_META_GENERIC_6 |
+6 |
+
+
+public static final int |
+HINT_BLOCK_META_GENERIC_7 |
+7 |
+
+
+public static final int |
+HINT_BLOCK_META_GENERIC_8 |
+8 |
+
+
+public static final int |
+HINT_BLOCK_META_GENERIC_9 |
+9 |
+
+
+public static final int |
+HINT_BLOCK_META_NOT_AIR |
+14 |
+
+
+public static final String |
+MOD_ID |
+"structurelib" |
+
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+Each annotation type has its own separate page with the following sections:
+Each enum has its own separate page with the following sections:
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+These links take you to the next or previous class, interface, package, or related page.
+These links show and hide the HTML frames. All pages are available with or without frames.
+The All Classes link shows all classes and interfaces except non-static nested types.
+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
+The Constant Field Values page lists the static final fields and their values.
+AutoPlaceEnvironment has implemented.MinecraftForge.EVENT_BUS by populating it with given arguments.IConstructable.StructureUtility.withContext(IStructureElement) in case you need to record some
+ temporary states that don't need to live in your main context, which would usually live for the whole lifetime of the
+ structure than just during structure check.int value between 0
+ (inclusive) and the specified value (exclusive), drawn from this random
+ number generator's sequence.StructureUtility.ofBlock(Block, int, Block, int) but ignores target meta idStructureUtility.ofBlocksTiered(ITierConverter, List, Object, BiConsumer, Function)
+ Main difference is this one is check only.IStructureElement to form a OR chain.IStructureElement to form a OR chain.World.setBlock(int x, int y, int z, Block block, int meta, int updateType) like:
+ world.setBlock(x,y,z,this/block,meta,2) where updateType 2 means to update lighting and stuffIStructureElement
+ should still implement this. implementor for private implementations can freely ignore this as long as you know
+ the caller will not call this overload.IItemSource.IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)setSeed(seed);.+ + diff --git a/1.2.0-beta.1/javadoc/overview-summary.html b/1.2.0-beta.1/javadoc/overview-summary.html new file mode 100644 index 00000000..662f7488 --- /dev/null +++ b/1.2.0-beta.1/javadoc/overview-summary.html @@ -0,0 +1,381 @@ + + + + + +
See: Description
+| Package | +Description | +
|---|---|
| com.gtnewhorizon.structurelib | ++ |
| com.gtnewhorizon.structurelib.alignment | +
+ This package provide a framework for rotating a given block, or a multiblock structure.
+ |
+
| com.gtnewhorizon.structurelib.alignment.constructable | +
+ This package contains interfaces and utility methods for autobuilding a structure.
+ |
+
| com.gtnewhorizon.structurelib.alignment.enumerable | ++ |
| com.gtnewhorizon.structurelib.structure | +
+ This package provide support for multiblock structure checking.
+ |
+
| com.gtnewhorizon.structurelib.structure.adders | +
+ Adder interfaces used in various standard structure elements.
+ |
+
| com.gtnewhorizon.structurelib.util | ++ |
+ Here we outline a few key API classes/interfaces. +
+ +IStructureDefinition+ This is the structure definition of your multi. + You will have one `IStructureDefinition` for each multi. +
+ +IStructureElement+ These are how you define which block will be accepted. +
+ +StructureUtility
+ This is the standard library of IStructureElements.
+ The Standard Library contains structure elements that handle basic block element and elements that allow composing
+ these basic elements.
+
IConstructable
+ This interface should be implemented by tile entities that support creative autoplacing and hint particle emitting.
+ You will usually want to have a backing IStructureDefinition
+ and call its build()
+ or hints() method here.
+
ISurvivalConstructable
+ This interface is an enhancement over IConstructable.
+ If your tile entities also support survival autoplacing then you should implement this.
+ You will usually want to have a backing IStructureDefinition
+ and call its survivalBuild().
+
IConstructableProvider+ This interface should be implemented on tile entities that will delegate all constructable or survival construable + functionality to some other class. + This is mostly only to support gregtech meta tile entity system. +
++ Return null if the delegate does not exist. +
+ +InventoryUtility
+ This class backs the standard implementations of IItemSource.
+ You might want to register new inventory provider or inventory extractor there to facilitate survival auto place.
+
IAlignmentProvider, IAlignment and IAlignmentLimits+ These interfaces will be used to implement rotation. + Provide a framework to rotate the block. + You can skip this if you store ExtendedFacing and do rotation in other means. +
+ +ChannelDataAccessor+ This class contains the accessors for channel data held on a trigger item. See below for more + information. +
+ +StructureLibAPI
+ This class contains the low level utility used for implementing new IStructureElement.
+ You will also need methods in this class to while implementing rotation.
+
+ IF THERE IS A SAME NAMED METHOD IN OTHER CLASS, ONLY USE METHODS FOUND IN THIS CLASS, NOT OTHER CLASS. + This abstraction is necessary so we can change how underlying code work (e.g. how hint particles are rendered) + without + breaking client code. +
+ +StructureEvent
+ This class is the base class of all events that will be posted while a IStructureDefinition are visited.
+ These events are disabled by default, and can be enabled by calling StructureLibAPI.enableInstrument(Object).
+ To receive these events, register an event handler to MinecraftForge.EVENT_BUS.
+ Handlers should filter the events received by StructureEvent.getInstrumentIdentifier().
+
+ These events are intended for third party tools to inspect structure details. Normal users should not use + these at all. +
+ +
+ Context Object are what you pass to IStructureDefinition.check(Object, String, World, ExtendedFacing, int, int,
+ int, int, int, int, boolean) and alike as first parameter. It will hold the necessary states for IStructureElement. It's usually, but not necessarily, the multiblock controller.
+
+ Standard structure element library offers method to switch context objects if needed. +
+ ++ Trigger Item is the item used to trigger hint spawn, creative build and survival auto place. + The trigger item will be passed to relevant classes as an indicator of structure tier. + The item type and stack tag compound of this item stack are opaque objects that should not be parsed. +
++ StructureLib comes with a trigger item implementation. + It does register it to the game registries, but does not come with a recipe. + Usually there is no reason to reimplement this on your own. +
+ ++ Trigger item carries the player's choice of structure tier by its stack size. + When one multi have multiple tiered component that can have interleaving tier, this becomes an obnoxious + restriction, as one ItemStack cannot have two stack sizes at the same time. + Here we use the channels to bypass this restriction. +
+ ++ Basically, channels are information stored on the trigger item's NBT tags. + One trigger item can carry multiple channels. + Each channel can be identified with lower case strings and has the value being one positive Java int. + There will be one and only one master channel and 0 or more sub channel. + When a non-existent sub channel is queried, master channel will be used instead to fill its place. +
+ ++ Structure Definition Author and/or Structure Element Author can choose whether they use a channel and which channel + to use. +
+ ++ Structure Element Author will usually not need to consider channels, i.e. proceed as if this concept does not exist, + unless it must take input from multiple channels. +
+ ++ Structure Definition Author will consider how to map each channel to each tiered component. + He will be using `com.gtnewhorizon.structurelib.structure.StructureUtility.withChannel` to direct structure element + on which channel to use. + Conceptually, it will return an ItemStack with the master channel being the value of selected channel. + In implementation, withChannel will return a new ItemStack with same item, nbt but different stack size. +
+ ++ It's worth mentioning that the returned new ItemStack will still have all the channel data on it, so a multi-channel + structure element can still query the channel it wants just fine. It is however impossible to recover the original + master channel. +
+ +GT++ Chemical Plant is a multi with 4 distinctly tiered component.
+ +It will use +
+.addElement('a', shellStructureElement())
+.addElement('b', withChannel("casing", machineCasingStructureElement()))
+.addElement('c', withChannel("pipe", pipeCasingStructureElement()))
+.addElement('d', withChannel("coil", coilStructureElement()))
+
+whereas all these structure elements are designed without considering channels whatsoever
+
++ Suppose your hatch element has a required facing and can accept arbitrary meta tile entity, so it will need both + meta id + and facing input. +
+ ++ It will use +
+ Its code will then look like +
+import com.gtnewhorizon.structurelib.structure.IStructureElement;
+
+public class MyHatchElement<T> implements IStructureElement<T> {
+ //...long seed+
boolean haveNextNextGaussian+
double nextNextGaussian+