-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,948 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
common/src/main/java/org/terraform/coregen/NaturalSpawnType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package org.terraform.coregen; | ||
|
||
public enum NaturalSpawnType { | ||
GUARDIAN, PILLAGER | ||
GUARDIAN, PILLAGER, WITCH | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
dependencies { | ||
implementation(project(":common")) | ||
compileOnly(group = "org.spigotmc", name = "spigot", version = "1.21.2-R0.1-SNAPSHOT") | ||
compileOnly("org.jetbrains:annotations:20.1.0") | ||
compileOnly("com.github.AvarionMC:yaml:1.1.3") | ||
} | ||
java { | ||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
} |
76 changes: 76 additions & 0 deletions
76
implementation/v1_21_R2/src/main/java/org/terraform/v1_21_R2/BlockDataFixer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package org.terraform.v1_21_R2; | ||
|
||
import org.bukkit.Tag; | ||
import org.bukkit.block.BlockFace; | ||
import org.bukkit.block.data.BlockData; | ||
import org.bukkit.block.data.type.Wall; | ||
import org.bukkit.block.data.type.Wall.Height; | ||
import org.bukkit.util.Vector; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.terraform.coregen.BlockDataFixerAbstract; | ||
import org.terraform.data.SimpleBlock; | ||
import org.terraform.utils.BlockUtils; | ||
|
||
public class BlockDataFixer extends BlockDataFixerAbstract { | ||
|
||
// --------[1.16 stuff] | ||
public static void correctWallData(@NotNull SimpleBlock target) { | ||
if (!(target.getBlockData() instanceof Wall data)) { | ||
return; | ||
} | ||
for (BlockFace face : BlockUtils.directBlockFaces) { | ||
if (target.getRelative(face).isSolid() && !target.getRelative(face) | ||
.getType() | ||
.toString() | ||
.contains("PRESSURE_PLATE")) | ||
{ | ||
data.setHeight(face, Height.LOW); | ||
if (target.getRelative(BlockFace.UP).isSolid()) { | ||
data.setHeight(face, Height.TALL); | ||
} | ||
} | ||
else { | ||
data.setHeight(face, Height.NONE); | ||
} | ||
} | ||
|
||
// target.setBlockData(data); | ||
} | ||
|
||
public static void correctSurroundingWallData(@NotNull SimpleBlock target) { | ||
if (!(target.getBlockData() instanceof Wall)) { | ||
return; | ||
} | ||
|
||
correctWallData(target); | ||
for (BlockFace face : BlockUtils.directBlockFaces) { | ||
if (Tag.WALLS.isTagged(target.getRelative(face).getType())) { | ||
correctWallData(target.getRelative(face)); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public String updateSchematic(double schematicVersion, String schematic) { | ||
return schematic; | ||
} | ||
|
||
@Override | ||
public void correctFacing(Vector v, @Nullable SimpleBlock b, @Nullable BlockData data, BlockFace face) { | ||
if (data == null && b != null) { | ||
data = b.getBlockData(); | ||
} | ||
|
||
if (!hasFlushed && data instanceof Wall) { | ||
this.pushChanges(v); | ||
return; | ||
} | ||
|
||
if (data instanceof Wall && b != null) { | ||
// 1.16 stuff. | ||
correctSurroundingWallData(b); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.