Use V2 pocket generators wherever possible

Changes to be committed:
	modified:   src/main/java/org/dimdev/dimdoors/pockets/PocketGenerator.java
	modified:   src/main/java/org/dimdev/dimdoors/rift/targets/PrivatePocketTarget.java
	modified:   src/main/java/org/dimdev/dimdoors/rift/targets/PublicPocketTarget.java
This commit is contained in:
SD 2020-10-03 10:13:00 +05:30
parent 255c7f7acd
commit 6fc1a174a3
No known key found for this signature in database
GPG key ID: E36B57EE08544BC5
3 changed files with 5 additions and 5 deletions

View file

@ -79,9 +79,9 @@ public final class PocketGenerator {
return generatePocketFromTemplate(DimensionalDoorsInitializer.getWorld(ModDimensions.PUBLIC), pocketTemplate, virtualLocation, linkTo, linkProperties); return generatePocketFromTemplate(DimensionalDoorsInitializer.getWorld(ModDimensions.PUBLIC), pocketTemplate, virtualLocation, linkTo, linkProperties);
} }
public static Pocket generatePublicPocketV2(VirtualLocation virtualLocation) { public static Pocket generatePublicPocketV2(VirtualLocation virtualLocation, VirtualTarget linkTo, LinkProperties linkProperties) {
PocketTemplateV2 pocketTemplate = SchematicV2Handler.getInstance().getRandomPublicPocket(); PocketTemplateV2 pocketTemplate = SchematicV2Handler.getInstance().getRandomPublicPocket();
return generateV2PocketFromTemplate(DimensionalDoorsInitializer.getWorld(ModDimensions.PUBLIC), pocketTemplate, virtualLocation, true); return generateV2PocketFromTemplate(DimensionalDoorsInitializer.getWorld(ModDimensions.PUBLIC), pocketTemplate, virtualLocation, linkTo, linkProperties);
} }
/** /**

View file

@ -39,7 +39,7 @@ public class PrivatePocketTarget extends VirtualTarget implements EntityTarget {
Pocket pocket = PrivatePocketData.instance().getPrivatePocket(uuid); Pocket pocket = PrivatePocketData.instance().getPrivatePocket(uuid);
if (pocket == null) { // generate the private pocket and get its entrances if (pocket == null) { // generate the private pocket and get its entrances
// set to where the pocket was first created // set to where the pocket was first created
pocket = PocketGenerator.generatePrivatePocket(new VirtualLocation(virtualLocation.getWorld(), virtualLocation.getX(), virtualLocation.getZ(), -1)); pocket = PocketGenerator.generatePrivatePocketV2(new VirtualLocation(virtualLocation.getWorld(), virtualLocation.getX(), virtualLocation.getZ(), -1));
PrivatePocketData.instance().setPrivatePocketID(uuid, pocket); PrivatePocketData.instance().setPrivatePocketID(uuid, pocket);
this.processEntity(pocket, RiftRegistry.instance().getPocketEntrance(pocket).getBlockEntity(), entity, uuid, yawOffset); this.processEntity(pocket, RiftRegistry.instance().getPocketEntrance(pocket).getBlockEntity(), entity, uuid, yawOffset);
@ -50,7 +50,7 @@ public class PrivatePocketTarget extends VirtualTarget implements EntityTarget {
destLoc = RiftRegistry.instance().getPocketEntrance(pocket); // if there's none, then set the target to the main entrances destLoc = RiftRegistry.instance().getPocketEntrance(pocket); // if there's none, then set the target to the main entrances
if (destLoc == null) { // if the pocket entrances is gone, then create a new private pocket if (destLoc == null) { // if the pocket entrances is gone, then create a new private pocket
LOGGER.info("All entrances are gone, creating a new private pocket!"); LOGGER.info("All entrances are gone, creating a new private pocket!");
pocket = PocketGenerator.generatePrivatePocket(new VirtualLocation(virtualLocation.getWorld(), virtualLocation.getX(), virtualLocation.getZ(), -1)); pocket = PocketGenerator.generatePrivatePocketV2(new VirtualLocation(virtualLocation.getWorld(), virtualLocation.getX(), virtualLocation.getZ(), -1));
PrivatePocketData.instance().setPrivatePocketID(uuid, pocket); PrivatePocketData.instance().setPrivatePocketID(uuid, pocket);
destLoc = RiftRegistry.instance().getPocketEntrance(pocket); destLoc = RiftRegistry.instance().getPocketEntrance(pocket);

View file

@ -41,7 +41,7 @@ public class PublicPocketTarget extends RestoringTarget {
VirtualLocation newVirtualLocation; VirtualLocation newVirtualLocation;
int depth = Math.max(riftVirtualLocation.getDepth(), 1); int depth = Math.max(riftVirtualLocation.getDepth(), 1);
newVirtualLocation = new VirtualLocation(riftVirtualLocation.getWorld(), riftVirtualLocation.getX(), riftVirtualLocation.getZ(), depth); newVirtualLocation = new VirtualLocation(riftVirtualLocation.getWorld(), riftVirtualLocation.getX(), riftVirtualLocation.getZ(), depth);
Pocket pocket = PocketGenerator.generatePublicPocket(newVirtualLocation, new GlobalReference(this.location), null); Pocket pocket = PocketGenerator.generatePublicPocketV2(newVirtualLocation, new GlobalReference(this.location), null);
return RiftRegistry.instance().getPocketEntrance(pocket); return RiftRegistry.instance().getPocketEntrance(pocket);
} }