Enabled the first dungeon Pockets
-Changed build number -The properties of rifts do not get read from the schematic -Added the start of what is going to be a system to force-generate a particular Dungeon Pocket schematic -Repaired a fault in choosing a random Dungeon Template -Restructured the loading of Schematic files from disk, to make the code more concise and less repetitive. -Remedied bug where Rifts in Dungeon Schematics did not get registered, because their ID was not -1 from the start. -Corrected naming of Chaos Door Block in the American localization -Added Dutch localisation -Added json file that loads 2 of the Dungeon Schematics (for now for testing purposes) Todo: -Apparently, DimDoors in the schematics don't have the right orientation until they get rendered. Maybe they should update their orientation for teleportation from the bottom block of the door -Add a command to generate a specific schematic as a Dungeon Pocket.
This commit is contained in:
parent
644eb370bf
commit
0c43bb51f5
12 changed files with 167 additions and 67 deletions
|
@ -10,7 +10,7 @@ buildscript {
|
||||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||||
//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup.
|
//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup.
|
||||||
|
|
||||||
ext.modversion = "3.0.0-a1"
|
ext.modversion = "3.0.0-a2"
|
||||||
ext.mcversion = "1.10.2"
|
ext.mcversion = "1.10.2"
|
||||||
ext.forgeversion = "12.18.3.2281"
|
ext.forgeversion = "12.18.3.2281"
|
||||||
//spongeSchematicVersion = "1"
|
//spongeSchematicVersion = "1"
|
||||||
|
|
|
@ -50,10 +50,11 @@ public abstract class DDProxyCommon implements IDDProxy {
|
||||||
TileEntityDimDoor dimTile = (TileEntityDimDoor) tile;
|
TileEntityDimDoor dimTile = (TileEntityDimDoor) tile;
|
||||||
IBlockState state = world.getBlockState(pos.down());
|
IBlockState state = world.getBlockState(pos.down());
|
||||||
dimTile.orientation = state.getBlock() instanceof BlockDimDoorBase
|
dimTile.orientation = state.getBlock() instanceof BlockDimDoorBase
|
||||||
? state.getValue(BlockDoor.FACING).rotateY()
|
? state.getValue(BlockDoor.FACING).rotateY() //@todo the rotateY here is very counter intuitive but seems needed for the render?
|
||||||
: ModBlocks.blockDimDoor.getDefaultState().getValue(BlockDoor.FACING);
|
: ModBlocks.blockDimDoor.getDefaultState().getValue(BlockDoor.FACING);
|
||||||
dimTile.doorIsOpen = door.isDoorOnRift(world, pos) && door.isUpperDoorBlock(world.getBlockState(pos));
|
dimTile.doorIsOpen = door.isDoorOnRift(world, pos) && door.isUpperDoorBlock(world.getBlockState(pos));
|
||||||
dimTile.lockStatus = 0;
|
dimTile.lockStatus = 0; //@todo
|
||||||
|
dimTile.markDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,9 @@ public class Pocket {
|
||||||
private static int findWarpDoorIndex(List<Integer> riftIDs) { //used to find the entrance door to this pocket
|
private static int findWarpDoorIndex(List<Integer> riftIDs) { //used to find the entrance door to this pocket
|
||||||
int index = -1;
|
int index = -1;
|
||||||
for (int i = 0; i < riftIDs.size(); i++) {
|
for (int i = 0; i < riftIDs.size(); i++) {
|
||||||
TileEntity tileEntity = RiftRegistry.INSTANCE.getRiftLocation(i).getTileEntity();
|
int riftID = riftIDs.get(i);
|
||||||
|
//DimDoors.log(Pocket.class, "findWarpDoorIndex: i = " + i + " riftID = " + riftID); //for troubleshooting purposes
|
||||||
|
TileEntity tileEntity = RiftRegistry.INSTANCE.getRiftLocation(riftID).getTileEntity();
|
||||||
if (tileEntity != null && tileEntity instanceof TileEntityDimDoorWarp) {
|
if (tileEntity != null && tileEntity instanceof TileEntityDimDoorWarp) {
|
||||||
index = i;
|
index = i;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -7,7 +7,9 @@ package com.zixiken.dimdoors.shared;
|
||||||
|
|
||||||
import com.zixiken.dimdoors.shared.util.Schematic;
|
import com.zixiken.dimdoors.shared.util.Schematic;
|
||||||
import com.zixiken.dimdoors.DimDoors;
|
import com.zixiken.dimdoors.DimDoors;
|
||||||
|
import com.zixiken.dimdoors.shared.blocks.BlockDimDoorBase;
|
||||||
import com.zixiken.dimdoors.shared.tileentities.DDTileEntityBase;
|
import com.zixiken.dimdoors.shared.tileentities.DDTileEntityBase;
|
||||||
|
import com.zixiken.dimdoors.shared.tileentities.TileEntityDimDoor;
|
||||||
import com.zixiken.dimdoors.shared.util.Location;
|
import com.zixiken.dimdoors.shared.util.Location;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -113,15 +115,18 @@ public class PocketTemplate { //there is exactly one pocket placer for each diff
|
||||||
DimDoors.log(this.getClass(), "Re-loading tile-entity at blockPos: " + pos.toString());
|
DimDoors.log(this.getClass(), "Re-loading tile-entity at blockPos: " + pos.toString());
|
||||||
TileEntity tileEntity = world.getTileEntity(pos);
|
TileEntity tileEntity = world.getTileEntity(pos);
|
||||||
if (tileEntity != null) {
|
if (tileEntity != null) {
|
||||||
tileEntity.readFromNBT(tileEntityNBT); //this reads in the wrong blockPos
|
|
||||||
tileEntity.setPos(pos); //correct position again
|
|
||||||
tileEntity.markDirty();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tileEntity instanceof DDTileEntityBase) {
|
if (tileEntity instanceof DDTileEntityBase) {
|
||||||
DimDoors.log(this.getClass(), "Rift found in schematic: " + pos.toString());
|
DimDoors.log(this.getClass(), "Rift found in schematic: " + pos.toString());
|
||||||
DDTileEntityBase rift = (DDTileEntityBase) tileEntity;
|
DDTileEntityBase rift = (DDTileEntityBase) tileEntity;
|
||||||
rifts.add(rift);
|
rifts.add(rift);
|
||||||
|
if (rift instanceof TileEntityDimDoor) {
|
||||||
|
DimDoors.proxy.updateDoorTE((BlockDimDoorBase) world.getBlockState(pos).getBlock(), world, pos);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tileEntity.readFromNBT(tileEntityNBT); //this reads in the wrong blockPos
|
||||||
|
}
|
||||||
|
tileEntity.setPos(pos); //correct the position
|
||||||
|
tileEntity.markDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,6 +134,9 @@ public class PocketTemplate { //there is exactly one pocket placer for each diff
|
||||||
for (DDTileEntityBase rift : rifts) {
|
for (DDTileEntityBase rift : rifts) {
|
||||||
rift.register(depth);
|
rift.register(depth);
|
||||||
rift.setIsInPocket();
|
rift.setIsInPocket();
|
||||||
|
rift.setPocket(pocketID, pocketTypeID);
|
||||||
|
rift.setDepth(depth);
|
||||||
|
|
||||||
riftIDs.add(rift.getRiftID());
|
riftIDs.add(rift.getRiftID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
*/
|
*/
|
||||||
public class RiftRegistry {
|
public class RiftRegistry {
|
||||||
|
|
||||||
|
private int lastGeneratedEntranceDoorID = -1;
|
||||||
private DDTileEntityBase lastBrokenRift = null; //@todo, redo this functionality in a more refined way
|
private DDTileEntityBase lastBrokenRift = null; //@todo, redo this functionality in a more refined way
|
||||||
public static final RiftRegistry INSTANCE = new RiftRegistry();
|
public static final RiftRegistry INSTANCE = new RiftRegistry();
|
||||||
|
|
||||||
|
@ -156,7 +157,7 @@ public class RiftRegistry {
|
||||||
nbt.setTag("unpairedDepthRiftList", unpairedRiftListsNBT);
|
nbt.setTag("unpairedDepthRiftList", unpairedRiftListsNBT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int registerNewRift(DDTileEntityBase rift, int depth) {
|
public int registerNewRift(DDTileEntityBase rift, final int depth) {
|
||||||
Location riftLocation = Location.getLocation(rift);
|
Location riftLocation = Location.getLocation(rift);
|
||||||
final int assignedID = nextRiftID;
|
final int assignedID = nextRiftID;
|
||||||
DimDoors.log(this.getClass(), "Starting registering rift as ID: " + assignedID);
|
DimDoors.log(this.getClass(), "Starting registering rift as ID: " + assignedID);
|
||||||
|
@ -167,7 +168,7 @@ public class RiftRegistry {
|
||||||
personalDoors.add(assignedID);
|
personalDoors.add(assignedID);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DimDoors.log(this.getClass(), "Registering rift in unpairedRiftRegistry. ID = " + assignedID);
|
DimDoors.log(this.getClass(), "Registering rift in unpairedRiftRegistry. ID = " + assignedID + " at depth: " + depth);
|
||||||
unpairedRifts.add(assignedID);
|
unpairedRifts.add(assignedID);
|
||||||
registerUnpairedRiftAtDepth(assignedID, depth);
|
registerUnpairedRiftAtDepth(assignedID, depth);
|
||||||
}
|
}
|
||||||
|
@ -199,16 +200,13 @@ public class RiftRegistry {
|
||||||
TileEntity tileEntity = rifts.get(riftID).getTileEntity();
|
TileEntity tileEntity = rifts.get(riftID).getTileEntity();
|
||||||
if (tileEntity instanceof DDTileEntityBase) {
|
if (tileEntity instanceof DDTileEntityBase) {
|
||||||
DDTileEntityBase rift = (DDTileEntityBase) tileEntity;
|
DDTileEntityBase rift = (DDTileEntityBase) tileEntity;
|
||||||
int depth = rift.getDepth();
|
unRegisterUnpairedRiftAtDepth(rift);
|
||||||
if (depth < maximumDungeonDepth) {
|
|
||||||
List<Integer> unpairedRiftListAtDepth = unpairedRiftsPerDepth.get(depth);
|
|
||||||
unpairedRiftListAtDepth.remove((Integer) riftID);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void unRegisterUnpairedRiftAtDepth(DDTileEntityBase rift) {
|
void unRegisterUnpairedRiftAtDepth(DDTileEntityBase rift) {
|
||||||
int depth = rift.getDepth();
|
int depth = rift.getDepth();
|
||||||
|
DimDoors.log(this.getClass(), "unregistering rift "+ rift.getRiftID() + " as unpaired at depth " + depth);
|
||||||
if (depth < maximumDungeonDepth) {
|
if (depth < maximumDungeonDepth) {
|
||||||
List<Integer> unpairedRiftListAtDepth = unpairedRiftsPerDepth.get(depth);
|
List<Integer> unpairedRiftListAtDepth = unpairedRiftsPerDepth.get(depth);
|
||||||
unpairedRiftListAtDepth.remove((Integer) rift.getRiftID());
|
unpairedRiftListAtDepth.remove((Integer) rift.getRiftID());
|
||||||
|
@ -298,6 +296,14 @@ public class RiftRegistry {
|
||||||
|
|
||||||
public int getRandomUnpairedRiftIDAtDepth(int origRiftID, int depth) {
|
public int getRandomUnpairedRiftIDAtDepth(int origRiftID, int depth) {
|
||||||
int returnID = -1;
|
int returnID = -1;
|
||||||
|
|
||||||
|
//After using a command to generate a particular schematic as a pocket to be the next non-random Golden (and randomly Iron) Dimdoor destination
|
||||||
|
if (this.lastGeneratedEntranceDoorID != -1) {
|
||||||
|
returnID = lastGeneratedEntranceDoorID;
|
||||||
|
lastGeneratedEntranceDoorID = -1;
|
||||||
|
return returnID;
|
||||||
|
}
|
||||||
|
|
||||||
if (unpairedRiftsPerDepth.size() > depth) {
|
if (unpairedRiftsPerDepth.size() > depth) {
|
||||||
List<Integer> rifts = unpairedRiftsPerDepth.get(depth);
|
List<Integer> rifts = unpairedRiftsPerDepth.get(depth);
|
||||||
int numberOfUnpairedRifts = rifts.size();
|
int numberOfUnpairedRifts = rifts.size();
|
||||||
|
@ -319,16 +325,16 @@ public class RiftRegistry {
|
||||||
returnID = rifts.get(randomRiftIDIndex);
|
returnID = rifts.get(randomRiftIDIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DimDoors.log(this.getClass(), "Rift to pair to chosen: returnID = " + returnID);
|
DimDoors.log(this.getClass(), "Rift to pair to was chosen: returnID = " + returnID);
|
||||||
return returnID;
|
return returnID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRandomUnpairedRiftIDAroundDepth(int origRiftID, int depth) {
|
public int getRandomUnpairedRiftIDAroundDepth(int origRiftID, int depth) {
|
||||||
int returnID = -1;
|
int returnID = -1;
|
||||||
if (unpairedRiftsPerDepth.size() > depth) {
|
if (unpairedRiftsPerDepth.size() > depth) {
|
||||||
int[] weights = getWeightSizeProducts(unpairedRiftsPerDepth, depth - 2, new int[]{15, 25, 30, 20, 10});
|
int[] weights = getWeightSizeProducts(unpairedRiftsPerDepth, depth - 2, new int[]{15, 25, 30, 20, 10}); //@todo put these values in config
|
||||||
if (getArraySum(weights) == 0) {
|
if (getArraySum(weights) == 0) {
|
||||||
//@todo there is no unpaired rift around that depth
|
//@todo there is no unpaired rift around those depths
|
||||||
} else {
|
} else {
|
||||||
int chosenDepth = pickRandom(weights) + depth - 2;
|
int chosenDepth = pickRandom(weights) + depth - 2;
|
||||||
returnID = getRandomUnpairedRiftIDAtDepth(origRiftID, chosenDepth);
|
returnID = getRandomUnpairedRiftIDAtDepth(origRiftID, chosenDepth);
|
||||||
|
|
|
@ -15,6 +15,7 @@ import java.io.DataInputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -55,15 +56,17 @@ public class SchematicHandler {
|
||||||
totalWeight += template.getWeight(depth);
|
totalWeight += template.getWeight(depth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
DimDoors.log(this.getClass(), "depth = " + depth + ". totalWeight = " + totalWeight);
|
||||||
|
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
int chosenTemplatePointer = random.nextInt(totalWeight);
|
int chosenTemplatePointer = random.nextInt(totalWeight);
|
||||||
for (PocketTemplate template : validTemplates) {
|
for (PocketTemplate template : validTemplates) {
|
||||||
|
chosenTemplatePointer -= template.getWeight(depth);
|
||||||
if (chosenTemplatePointer < 0) {
|
if (chosenTemplatePointer < 0) {
|
||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
chosenTemplatePointer -= template.getWeight(depth);
|
|
||||||
}
|
}
|
||||||
|
DimDoors.warn(this.getClass(), "No valid dungeon could be chosen for this depth. What have you done to make this happen? Now crashing:");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,58 +137,53 @@ public class SchematicHandler {
|
||||||
//DimDoors.log(SchematicHandler.class, "Checkpoint 4 reached; " + validTemplates.size() + " templates were loaded");
|
//DimDoors.log(SchematicHandler.class, "Checkpoint 4 reached; " + validTemplates.size() + " templates were loaded");
|
||||||
|
|
||||||
for (PocketTemplate template : validTemplates) { //it's okay to "tap" this for-loop, even if validTemplates is empty.
|
for (PocketTemplate template : validTemplates) { //it's okay to "tap" this for-loop, even if validTemplates is empty.
|
||||||
String subDirectory = jsonTemplate.get("directory").getAsString(); //subfolder in which the schematics are stored
|
String subDirectory = jsonTemplate.get("directory").getAsString(); //get the subfolder in which the schematics are stored
|
||||||
String extendedTemplatelocation = subDirectory.equals("") ? template.getName() : subDirectory + "/" + template.getName();
|
String extendedTemplatelocation = subDirectory.equals("") ? template.getName() : subDirectory + "/" + template.getName(); //transform the filename accordingly
|
||||||
InputStream schematicStream = DimDoors.class.getResourceAsStream(schematicJarDirectory + extendedTemplatelocation + ".schem"); //@todo also check for other schematics
|
|
||||||
|
//Initialising the possible locations/formats for the schematic file
|
||||||
|
InputStream schematicStream = DimDoors.class.getResourceAsStream(schematicJarDirectory + extendedTemplatelocation + ".schem");
|
||||||
InputStream oldVersionSchematicStream = DimDoors.class.getResourceAsStream(schematicJarDirectory + extendedTemplatelocation + ".schematic"); //@todo also check for other schematics
|
InputStream oldVersionSchematicStream = DimDoors.class.getResourceAsStream(schematicJarDirectory + extendedTemplatelocation + ".schematic"); //@todo also check for other schematics
|
||||||
File schematicFile = new File(schematicFolder, "/" + extendedTemplatelocation + ".schem");
|
File schematicFile = new File(schematicFolder, "/" + extendedTemplatelocation + ".schem");
|
||||||
File oldVersionSchematicFile = new File(schematicFolder, "/" + extendedTemplatelocation + ".schematic");
|
File oldVersionSchematicFile = new File(schematicFolder, "/" + extendedTemplatelocation + ".schematic");
|
||||||
NBTTagCompound schematicNBT;
|
|
||||||
|
|
||||||
//@todo make the following block less repetitious.
|
//determine which location to load the schematic file from (and what format)
|
||||||
//try to load the schematic from 4 different locations/formats
|
DataInputStream schematicDataStream = null;
|
||||||
Schematic schematic = null;
|
|
||||||
if (schematicStream != null) {
|
if (schematicStream != null) {
|
||||||
try {
|
schematicDataStream = new DataInputStream(schematicStream);
|
||||||
try (DataInputStream schematicDataStream = new DataInputStream(schematicStream)) {
|
|
||||||
schematicNBT = CompressedStreamTools.readCompressed(schematicDataStream);
|
|
||||||
schematic = Schematic.loadFromNBT(schematicNBT);
|
|
||||||
}
|
|
||||||
} catch (IOException ex) {
|
|
||||||
Logger.getLogger(SchematicHandler.class.getName()).log(Level.SEVERE, "Schematic file " + template.getName() + ".schem did not load correctly from jar.", ex);
|
|
||||||
} finally {
|
|
||||||
}
|
|
||||||
} else if (oldVersionSchematicStream != null) {
|
} else if (oldVersionSchematicStream != null) {
|
||||||
try {
|
schematicDataStream = new DataInputStream(oldVersionSchematicStream);
|
||||||
try (DataInputStream schematicDataStream = new DataInputStream(oldVersionSchematicStream)) {
|
|
||||||
schematicNBT = CompressedStreamTools.readCompressed(schematicDataStream);
|
|
||||||
schematic = Schematic.loadFromNBT(schematicNBT);
|
|
||||||
}
|
|
||||||
} catch (IOException ex) {
|
|
||||||
Logger.getLogger(SchematicHandler.class.getName()).log(Level.SEVERE, "Schematic file " + template.getName() + ".schematic did not load correctly from jar.", ex);
|
|
||||||
}
|
|
||||||
} else if (schematicFile.exists()) {
|
} else if (schematicFile.exists()) {
|
||||||
try {
|
try {
|
||||||
try (DataInputStream schematicDataStream = new DataInputStream(new FileInputStream(schematicFile))) {
|
schematicDataStream = new DataInputStream(new FileInputStream(schematicFile));
|
||||||
schematicNBT = CompressedStreamTools.readCompressed(schematicDataStream);
|
} catch (FileNotFoundException ex) {
|
||||||
schematic = Schematic.loadFromNBT(schematicNBT);
|
|
||||||
}
|
|
||||||
} catch (IOException ex) {
|
|
||||||
Logger.getLogger(SchematicHandler.class.getName()).log(Level.SEVERE, "Schematic file " + template.getName() + ".schem did not load correctly from config folder.", ex);
|
Logger.getLogger(SchematicHandler.class.getName()).log(Level.SEVERE, "Schematic file " + template.getName() + ".schem did not load correctly from config folder.", ex);
|
||||||
}
|
}
|
||||||
} else if (oldVersionSchematicFile.exists()) {
|
} else if (oldVersionSchematicFile.exists()) {
|
||||||
try {
|
try {
|
||||||
try (DataInputStream schematicDataStream = new DataInputStream(new FileInputStream(oldVersionSchematicFile))) {
|
schematicDataStream = new DataInputStream(new FileInputStream(oldVersionSchematicFile));
|
||||||
schematicNBT = CompressedStreamTools.readCompressed(schematicDataStream);
|
} catch (FileNotFoundException ex) {
|
||||||
schematic = Schematic.loadFromNBT(schematicNBT);
|
|
||||||
}
|
|
||||||
} catch (IOException ex) {
|
|
||||||
Logger.getLogger(SchematicHandler.class.getName()).log(Level.SEVERE, "Schematic file " + template.getName() + ".schematic did not load correctly from config folder.", ex);
|
Logger.getLogger(SchematicHandler.class.getName()).log(Level.SEVERE, "Schematic file " + template.getName() + ".schematic did not load correctly from config folder.", ex);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DimDoors.warn(SchematicHandler.class, "Schematic '" + template.getName() + "' was not found in the jar or config directory, neither with the .schem extension, nor with the .schematic extension.");
|
DimDoors.warn(SchematicHandler.class, "Schematic '" + template.getName() + "' was not found in the jar or config directory, neither with the .schem extension, nor with the .schematic extension.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NBTTagCompound schematicNBT;
|
||||||
|
Schematic schematic = null;
|
||||||
|
try {
|
||||||
|
schematicNBT = CompressedStreamTools.readCompressed(schematicDataStream);
|
||||||
|
schematic = Schematic.loadFromNBT(schematicNBT);
|
||||||
|
schematicDataStream.close();
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Logger.getLogger(SchematicHandler.class.getName()).log(Level.SEVERE, "Schematic file for " + template.getName() + " could not be read as a valid schematic NBT file.", ex);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
schematicDataStream.close();
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Logger.getLogger(SchematicHandler.class.getName()).log(Level.SEVERE, "Error occured while closing schematicDataStream", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (schematic != null
|
if (schematic != null
|
||||||
&& (schematic.getWidth() > (template.getSize() + 1) * 16 || schematic.getLength() > (template.getSize() + 1) * 16)) {
|
&& (schematic.getWidth() > (template.getSize() + 1) * 16 || schematic.getLength() > (template.getSize() + 1) * 16)) {
|
||||||
schematic = null;
|
schematic = null;
|
||||||
|
@ -292,7 +290,7 @@ public class SchematicHandler {
|
||||||
schematicDataStream.flush();
|
schematicDataStream.flush();
|
||||||
schematicDataStream.close();
|
schematicDataStream.close();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(SchematicHandler.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(SchematicHandler.class.getName()).log(Level.SEVERE, "Something went wrong while saving " + saveFile.getAbsolutePath() + " to disk.", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,12 +74,12 @@ public abstract class DDTileEntityBase extends TileEntity implements ITickable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void register(int depth) {
|
public void register(int depth) {
|
||||||
if (riftID == -1) {
|
//if (riftID == -1) { //this check only causes problems?
|
||||||
riftID = RiftRegistry.INSTANCE.registerNewRift(this, depth);
|
riftID = RiftRegistry.INSTANCE.registerNewRift(this, depth);
|
||||||
DimDoors.log(this.getClass(), "Finished registering rift as ID: " + riftID);
|
DimDoors.log(this.getClass(), "Finished registering rift as ID: " + riftID);
|
||||||
|
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -164,6 +164,11 @@ public abstract class DDTileEntityBase extends TileEntity implements ITickable {
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDepth(int depth) {
|
||||||
|
this.depth = depth;
|
||||||
|
this.markDirty();
|
||||||
|
}
|
||||||
|
|
||||||
protected EnumPocketType getPocketType() {
|
protected EnumPocketType getPocketType() {
|
||||||
return pocketType;
|
return pocketType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import com.zixiken.dimdoors.shared.EnumPocketType;
|
||||||
import com.zixiken.dimdoors.shared.IChunkLoader;
|
import com.zixiken.dimdoors.shared.IChunkLoader;
|
||||||
import com.zixiken.dimdoors.shared.PocketRegistry;
|
import com.zixiken.dimdoors.shared.PocketRegistry;
|
||||||
import com.zixiken.dimdoors.shared.RiftRegistry;
|
import com.zixiken.dimdoors.shared.RiftRegistry;
|
||||||
import com.zixiken.dimdoors.shared.util.DDRandomUtils;
|
|
||||||
import com.zixiken.dimdoors.shared.util.Location;
|
import com.zixiken.dimdoors.shared.util.Location;
|
||||||
import net.minecraftforge.common.ForgeChunkManager;
|
import net.minecraftforge.common.ForgeChunkManager;
|
||||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||||
|
|
|
@ -324,7 +324,7 @@ public class Schematic {
|
||||||
|
|
||||||
NBTTagList paletteNBT = (NBTTagList) nbt.getTag("Palette");
|
NBTTagList paletteNBT = (NBTTagList) nbt.getTag("Palette");
|
||||||
for (int i = 0; i < paletteNBT.tagCount(); i++) {
|
for (int i = 0; i < paletteNBT.tagCount(); i++) {
|
||||||
DimDoors.log(Schematic.class, "reading pallete from schematic... i = " + i);
|
//DimDoors.log(Schematic.class, "reading pallete from schematic... i = " + i);
|
||||||
String blockString = paletteNBT.getStringTagAt(i);
|
String blockString = paletteNBT.getStringTagAt(i);
|
||||||
boolean isAncientFabric = false;
|
boolean isAncientFabric = false;
|
||||||
if (blockString.startsWith("dimdoors")) {
|
if (blockString.startsWith("dimdoors")) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ tile.blockFabricEternal.name=Eternal Fabric
|
||||||
tile.blockFabricUnraveled.name=Unraveled Fabric
|
tile.blockFabricUnraveled.name=Unraveled Fabric
|
||||||
tile.dimDoorWarp.name=Warp Door
|
tile.dimDoorWarp.name=Warp Door
|
||||||
tile.blockRift.name=Rift
|
tile.blockRift.name=Rift
|
||||||
tile.chaosDoor.name=Unstable Door
|
tile.chaosDoor.name=Chaos Door
|
||||||
tile.dimDoor.name=Dimensional Door
|
tile.dimDoor.name=Dimensional Door
|
||||||
tile.blockDimHatch.name=Transdimensional Trapdoor
|
tile.blockDimHatch.name=Transdimensional Trapdoor
|
||||||
item.itemDoorGold.name=Golden Door
|
item.itemDoorGold.name=Golden Door
|
||||||
|
|
60
src/main/resources/assets/dimdoors/lang/nl_NL.lang
Normal file
60
src/main/resources/assets/dimdoors/lang/nl_NL.lang
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
itemGroup.dimDoorsCreativeTab=Dimensional Doors Voorwerpen
|
||||||
|
tile.doorGold.name=Gouden Deur
|
||||||
|
tile.transientDoor.name=Vergankelijke Deur
|
||||||
|
tile.dimDoorGold.name=Gouden Dimensiedeur
|
||||||
|
tile.doorQuartz.name=Kwartsen Deur
|
||||||
|
tile.dimDoorPersonal.name=Persoonlijke Dimensiedeur
|
||||||
|
tile.blockFabricReality.name=Werkelijkheidsweefsel
|
||||||
|
tile.blockFabricAltered.name=Veranderd Weefsel
|
||||||
|
tile.blockFabricAncient.name=Aloud Weefsel
|
||||||
|
tile.blockFabricEternal.name=Oneindig Weefsel
|
||||||
|
tile.blockFabricUnraveled.name=Ontraveld Weefsel
|
||||||
|
tile.dimDoorWarp.name=Verdraaideur
|
||||||
|
tile.blockRift.name=Scheur
|
||||||
|
tile.chaosDoor.name=Chaos Deur
|
||||||
|
tile.dimDoor.name=Dimensiedeur
|
||||||
|
tile.blockDimHatch.name=Transdimensionale Valdeur
|
||||||
|
item.itemDoorGold.name=Gouden Deur
|
||||||
|
item.itemDDKey=Scheur Sleutel
|
||||||
|
item.itemDoorQuartz.name=Kwartsen Deur
|
||||||
|
item.itemDimDoorQuartz.name=Persoonlijke Dimensiedeur
|
||||||
|
item.itemDimDoorGold.name=Gouden Dimensiedeur
|
||||||
|
item.itemDimDoor.name=Dimensiedeur
|
||||||
|
item.itemDimDoorWarp.name=Verdraaideur
|
||||||
|
item.itemLinkSignature.name=Scheurtekening
|
||||||
|
item.itemStabilizedRiftSig.name=Gestabiliseerde Scheurtekening
|
||||||
|
item.itemRiftConnectionTool.name=Ondergemiddeld Scheurverbindingsgereedschap
|
||||||
|
item.itemRiftRemover.name=Scheurverwijderaar
|
||||||
|
item.itemStableFabric.name=Stabiel Weefsel
|
||||||
|
item.itemDimDoorChaos.name=Chaos Deur
|
||||||
|
item.itemRiftBlade.name=Scheurkling
|
||||||
|
item.itemWorldThread.name=Werelddraad
|
||||||
|
info.riftkey.bound=Gebonden
|
||||||
|
info.riftkey.unbound=Ontbonden
|
||||||
|
info.dimDoor0=Plaats op het blok onder een scheur
|
||||||
|
info.dimDoor1=om deze scheur te activeren of
|
||||||
|
info.dimDoor2=op een andere plaats om een
|
||||||
|
info.dimDoor3=publieke broekzak-dimensie te creëren.
|
||||||
|
info.goldDimDoor0=Net als een Dimensiedeur, maar houdt
|
||||||
|
info.goldDimDoor1=een broekzak dimensie geladen als
|
||||||
|
info.goldDimDoor2=deze er binnen geplaatst wordt.
|
||||||
|
info.personalDimDoor0=Creëert een pad naar
|
||||||
|
info.personalDimDoor1=je persoonlijke broekzak
|
||||||
|
info.riftblade0=Opent tijdelijke deuren op scheuren
|
||||||
|
info.riftblade1=en heeft een teleportatie aanval.
|
||||||
|
info.riftRemover0=Gebruik dichtbij een scheur
|
||||||
|
info.riftRemover1=om het te verwijderen en
|
||||||
|
info.riftRemover2=alle dichtbijzijnde scheuren.
|
||||||
|
info.riftSignature.bound=Leidt naar (%d, %d, %d) in dimensie #%d
|
||||||
|
info.riftSignature.unbound0=De eerste klik slaat een locatie op;
|
||||||
|
info.riftSignature.unbound1=de tweede creëert een paar scheuren
|
||||||
|
info.riftSignature.unbound2=die beide locaties met elkaar verbinden.
|
||||||
|
info.riftSignature.stable0=De eerste klik slaat een locatie op,
|
||||||
|
info.riftSignature.stable1=andere klikken creëren scheuren die de eerste
|
||||||
|
info.riftSignature.stable2=en laatste locaties met elkaar verbinden.
|
||||||
|
info.chaosDoor=Pas op: Leidt naar een willekeurige bestemming
|
||||||
|
info.warpDoor0=Plaats op het blok onder een scheur
|
||||||
|
info.warpDoor1=om een portaal te creëren,
|
||||||
|
info.warpDoor2=of plaats het ergens in een
|
||||||
|
info.warpDoor3=broekzak dimensie om deze te verlaten.
|
||||||
|
entity.dimdoors.Monolith.name=Monoliet
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"directory": "ruins",
|
||||||
|
"jsonType": "Multiple",
|
||||||
|
"pocketType" : 2,
|
||||||
|
"variations": [
|
||||||
|
{
|
||||||
|
"variantName": "ComplexHall_Balgor0-CrumbledHall_Closed_75",
|
||||||
|
"size": 2,
|
||||||
|
"minDepth": 1,
|
||||||
|
"maxDepth": 6,
|
||||||
|
"weights": [10, 20, 10, 10, 10, 10]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"variantName": "ComplexHall_Cere-JumpPass_Open_75",
|
||||||
|
"size": 1,
|
||||||
|
"minDepth": 1,
|
||||||
|
"maxDepth": 8,
|
||||||
|
"weights": [10, 10, 20, 10, 10, 10, 5, 5]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in a new issue