public enum JobManager extends java.lang.Enum<JobManager>
| Modifier and Type | Class and Description |
|---|---|
static interface |
JobManager.JobConsumer
Utility interface for
addJobBatch(EntityPlayer, boolean, Stream). |
static interface |
JobManager.JobSupplier
Utility interface for
addJobBatch(EntityPlayer, boolean, Stream). |
static interface |
JobManager.JobTester
Utility interface for
getJobTester(World). |
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
void |
addJobBatch(net.minecraft.entity.player.EntityPlayer player,
boolean allowPartial,
java.util.stream.Stream<JobManager.JobSupplier> provider)
Add a batch of jobs which will be sorted by their respective sort orders
amongst each other.
|
JobManager.JobTester |
getJobTester(net.minecraft.world.World world)
Get an object for the specified world that can be used to test for the
presence of jobs at some position in that world.
|
void |
onChunkLoad(net.minecraftforge.event.world.ChunkDataEvent.Load event) |
void |
onChunkSave(net.minecraftforge.event.world.ChunkDataEvent.Save event) |
void |
onChunkUnload(net.minecraftforge.event.world.ChunkEvent.Unload event) |
void |
onWorldTick(net.minecraftforge.fml.common.gameevent.TickEvent.WorldTickEvent event) |
void |
onWorldUnload(net.minecraftforge.event.world.WorldEvent.Unload event) |
static JobManager |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static JobManager[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JobManager INSTANCE
public static JobManager[] values()
for (JobManager c : JobManager.values()) System.out.println(c);
public static JobManager valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic void addJobBatch(net.minecraft.entity.player.EntityPlayer player,
boolean allowPartial,
java.util.stream.Stream<JobManager.JobSupplier> provider)
This is a little bit roundabout, as we want to abstract all internal bookkeeping logic needed for the sorting of added jobs. Essentially this is a "for each job you can give me, please tell this object what that job is", with "this object" being the instance with internal bookkeeping.
player - the player creating the jobs.allowPartial - whether to allow partial placement.provider - the stream to query for jobs.public JobManager.JobTester getJobTester(net.minecraft.world.World world)
This is used as a performance shortcut when batch-adding jobs, as it saves us the manager lookup for each potentially added job.
world - the world to get the tester for.public void onWorldTick(net.minecraftforge.fml.common.gameevent.TickEvent.WorldTickEvent event)
public void onWorldUnload(net.minecraftforge.event.world.WorldEvent.Unload event)
public void onChunkLoad(net.minecraftforge.event.world.ChunkDataEvent.Load event)
public void onChunkSave(net.minecraftforge.event.world.ChunkDataEvent.Save event)
public void onChunkUnload(net.minecraftforge.event.world.ChunkEvent.Unload event)