Use placeholders for gateways

Changes to be committed:
	modified:   src/main/java/org/dimdev/dimdoors/pockets/DefaultDungeonDestinations.java
	modified:   src/main/java/org/dimdev/dimdoors/pockets/PocketTemplateV2.java
	deleted:    src/main/java/org/dimdev/dimdoors/util/reference/BlockReference.java
	modified:   src/main/resources/data/dimdoors/gateways/v2/sandstone_pillars.schem
	modified:   src/main/resources/data/dimdoors/gateways/v2/two_pillars.schem
	new file:   src/main/resources/data/dimdoors/pockets/schematic/v2/blank/black_pocket_1.schem
	new file:   src/main/resources/data/dimdoors/pockets/schematic/v2/blank/blank_pocket_0.schem
	new file:   src/main/resources/data/dimdoors/pockets/schematic/v2/blank/blank_pocket_2.schem
	new file:   src/main/resources/data/dimdoors/pockets/schematic/v2/blank/blank_pocket_3.schem
	new file:   src/main/resources/data/dimdoors/pockets/schematic/v2/blank/blank_pocket_4.schem
	new file:   src/main/resources/data/dimdoors/pockets/schematic/v2/blank/blank_pocket_5.schem
	new file:   src/main/resources/data/dimdoors/pockets/schematic/v2/blank/blank_pocket_6.schem
	new file:   src/main/resources/data/dimdoors/pockets/schematic/v2/blank/blank_pocket_7.schem
This commit is contained in:
SD 2020-10-11 10:33:18 +05:30
parent 06801bd6c6
commit 8649c69d93
No known key found for this signature in database
GPG key ID: E36B57EE08544BC5
13 changed files with 13 additions and 36 deletions

View file

@ -9,19 +9,19 @@ import org.dimdev.dimdoors.rift.targets.PocketEntranceMarker;
import org.dimdev.dimdoors.rift.targets.RandomTarget;
import org.dimdev.dimdoors.rift.targets.VirtualTarget;
public final class DefaultDungeonDestinations { // TODO: lower weights?
public static final LinkProperties POCKET_LINK_PROPERTIES = LinkProperties.builder()
public interface DefaultDungeonDestinations { // TODO: lower weights?
LinkProperties POCKET_LINK_PROPERTIES = LinkProperties.builder()
.groups(new HashSet<>(Arrays.asList(0, 1)))
.linksRemaining(1)
.build();
public static final LinkProperties OVERWORLD_LINK_PROPERTIES = LinkProperties.builder()
LinkProperties OVERWORLD_LINK_PROPERTIES = LinkProperties.builder()
.groups(new HashSet<>(Arrays.asList(0, 1)))
.entranceWeight(50)
.linksRemaining(1)
.build();
public static final VirtualTarget DEEPER_DUNGEON_DESTINATION = RandomTarget.builder()
VirtualTarget DEEPER_DUNGEON_DESTINATION = RandomTarget.builder()
.acceptedGroups(Collections.singleton(0))
.coordFactor(1)
.negativeDepthFactor(10000)
@ -30,7 +30,7 @@ public final class DefaultDungeonDestinations { // TODO: lower weights?
.newRiftWeight(1)
.build();
public static final VirtualTarget SHALLOWER_DUNGEON_DESTINATION = RandomTarget.builder()
VirtualTarget SHALLOWER_DUNGEON_DESTINATION = RandomTarget.builder()
.acceptedGroups(Collections.singleton(0))
.coordFactor(1)
.negativeDepthFactor(160)
@ -39,7 +39,7 @@ public final class DefaultDungeonDestinations { // TODO: lower weights?
.newRiftWeight(1)
.build();
public static final VirtualTarget OVERWORLD_DESTINATION = RandomTarget.builder()
VirtualTarget OVERWORLD_DESTINATION = RandomTarget.builder()
.acceptedGroups(Collections.singleton(0))
.coordFactor(1)
.negativeDepthFactor(0.00000000001) // The division result is cast to an int, so Double.MIN_VALUE would cause an overflow
@ -48,7 +48,7 @@ public final class DefaultDungeonDestinations { // TODO: lower weights?
.newRiftWeight(1)
.build();
public static final VirtualTarget TWO_WAY_POCKET_ENTRANCE = PocketEntranceMarker.builder()
VirtualTarget TWO_WAY_POCKET_ENTRANCE = PocketEntranceMarker.builder()
.weight(1)
.ifDestination(new PocketEntranceMarker())
.otherwiseDestination(RandomTarget.builder()
@ -61,7 +61,7 @@ public final class DefaultDungeonDestinations { // TODO: lower weights?
.build())
.build();
public static final VirtualTarget GATEWAY_DESTINATION = RandomTarget.builder()
VirtualTarget GATEWAY_DESTINATION = RandomTarget.builder()
.acceptedGroups(Collections.singleton(0))
.coordFactor(1) // TODO: lower value?
.negativeDepthFactor(Double.POSITIVE_INFINITY)

View file

@ -93,12 +93,11 @@ public class PocketTemplateV2 {
}
schematic.setBlockEntities(blockEntities);
List<CompoundTag> entities = new ArrayList<>();
for (CompoundTag entityTag : schematic.getEntities()) {
TemplateUtils.setupEntityPlaceholders(entities, entityTag);
}
schematic.setEntities(entities);
// List<CompoundTag> entities = new ArrayList<>();
// for (CompoundTag entityTag : schematic.getEntities()) {
// TemplateUtils.setupEntityPlaceholders(entities, entityTag);
// }
// schematic.setEntities(entities);
replacingPlaceholders = false;
}

View file

@ -1,22 +0,0 @@
package org.dimdev.dimdoors.util.reference;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class BlockReference {
public final World world;
public final int x;
public final int y;
public final int z;
public BlockReference(World world, int x, int y, int z) {
this.world = world;
this.x = x;
this.y = y;
this.z = z;
}
public BlockPos getBlockPos() {
return new BlockPos(x, y, z);
}
}