Update pockets and fix registry recursion bug
This commit is contained in:
parent
87416e442d
commit
7fb9e8bd85
36 changed files with 29 additions and 25 deletions
|
@ -26,6 +26,7 @@ public class RiftRegistry extends WorldSavedData {
|
|||
private static final String SUBREGISTRY_DATA_NAME = DimDoors.MODID + "_rifts";
|
||||
|
||||
protected Map<Integer, RiftSubregistry> subregistries = new HashMap<>();
|
||||
private static RiftRegistry riftRegistry = null; // For use by RiftSubregistry only
|
||||
protected DefaultDirectedGraph<RegistryVertex, DefaultEdge> graph = new DefaultDirectedGraph<>(DefaultEdge.class);
|
||||
// TODO: add methods that automatically add vertices/edges and mark appropriate subregistries as dirty
|
||||
|
||||
|
@ -41,9 +42,9 @@ public class RiftRegistry extends WorldSavedData {
|
|||
|
||||
// <editor-fold defaultstate="collapsed" desc="Code for reading/writing/getting the registry">
|
||||
|
||||
|
||||
public static class RiftSubregistry extends WorldSavedData {
|
||||
private int dim;
|
||||
RiftRegistry riftRegistry = (RiftRegistry) WorldUtils.getWorld(0).getMapStorage().getOrLoadData(RiftRegistry.class, DATA_NAME);
|
||||
|
||||
public RiftSubregistry() {
|
||||
super(SUBREGISTRY_DATA_NAME);
|
||||
|
@ -152,9 +153,12 @@ public class RiftRegistry extends WorldSavedData {
|
|||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
riftRegistry = this;
|
||||
|
||||
// Trigger the subregistry reading code for all dimensions. It would be better if there was some way of forcing
|
||||
// them to be read from somewhere else, since this is technically more than just reading the NBT. This has to be
|
||||
// done last since links are only in the subregistries.
|
||||
// them to be read from somewhere else, since this is technically more than just reading the NBT and can cause
|
||||
// problems with recursion without riftRegistry. This has to be done last since links are only
|
||||
// in the subregistries.
|
||||
// TODO: If non-dirty but new WorldSavedDatas aren't automatically saved, then create the subregistries here
|
||||
// TODO: rather then in the markSubregistryDirty method.
|
||||
// TODO: try to get rid of this code:
|
||||
|
|
|
@ -99,16 +99,16 @@ public final class PocketSchematicGenerator {
|
|||
ModBlocks.ANCIENT_FABRIC.getDefaultState(), // outer wall
|
||||
ModBlocks.FABRIC.getDefaultState(), // inner wall
|
||||
ModBlocks.DIMENSIONAL_DOOR, // door
|
||||
PocketExitDestination.builder().build(),
|
||||
1)); // exit rift destination
|
||||
PocketExitDestination.builder().build(),// exit rift destination
|
||||
1)); // TODO: pass destination rather than just chaos weight
|
||||
schematics.add(generatePocketSchematic(
|
||||
"private_pocket", // base name
|
||||
pocketSize, // size
|
||||
ModBlocks.ANCIENT_FABRIC.getDefaultState().withProperty(BlockFabricAncient.COLOR, EnumDyeColor.WHITE), // outer wall
|
||||
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabricAncient.COLOR, EnumDyeColor.WHITE), // inner wall
|
||||
ModBlocks.PERSONAL_DIMENSIONAL_DOOR, // door
|
||||
PrivatePocketExitDestination.builder().build(),
|
||||
0)); // exit rift destination
|
||||
PrivatePocketExitDestination.builder().build(),// exit rift destination
|
||||
0));
|
||||
}
|
||||
return schematics;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ public class WorldProviderPersonalPocket extends WorldProviderPocket {
|
|||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
hasSkyLight = false; // TODO: figure out why relighting takes so long with private pockets only...
|
||||
biomeProvider = new BiomeProviderSingle(ModBiomes.WHITE_VOID);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,8 +15,7 @@ public abstract class WorldProviderPocket extends WorldProvider {
|
|||
|
||||
@Override
|
||||
public void init() {
|
||||
// TODO: save pocket registry nbt here? (see WorldProviderEnd)
|
||||
hasSkyLight = true; // TODO: this is only a temporary fix
|
||||
hasSkyLight = true;
|
||||
generateLightBrightnessTable();
|
||||
DimDoors.proxy.setCloudRenderer(this, new CloudRenderBlank());
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_black" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_blue" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_brown" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_cyan" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_gray" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_green" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_light_blue" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_lime" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_magenta" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_orange" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_pink" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_purple" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_red" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_silver" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_white" }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"parent": "dimdoors:block/fullbright",
|
||||
"textures": { "all": "dimdoors:blocks/fabric_yellow" }
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue