Skip to content

Commit

Permalink
Merge pull request #829 from VolmitSoftware/Development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
NextdoorPsycho authored Jul 16, 2022
2 parents f52cd29 + b82edfe commit 1cb2ea6
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plugins {
id "de.undercouch.download" version "5.0.1"
}

version '2.2.3-1.19' // Needs to be version specific
version '2.2.4-1.19' // Needs to be version specific
def nmsVersion = "1.19"
def apiVersion = '1.19'
def spigotJarVersion = '1.19-R0.1-SNAPSHOT'
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/volmit/iris/core/commands/CommandIris.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

@Decree(name = "iris", aliases = {"ir", "irs"}, description = "Basic Command")
@Decree(name = "iris", aliases = {"ir", "irs", "i"}, description = "Basic Command")
public class CommandIris implements DecreeExecutor {
private CommandStudio studio;
private CommandPregen pregen;
Expand Down Expand Up @@ -107,6 +107,12 @@ public void height() {
sender().sendMessage(C.GREEN + "Total Height: " + (sender().player().getWorld().getMaxHeight() - sender().player().getWorld().getMinHeight()));
}

@Decree(description = "QOL command to open a overworld studio world.")
public void so() {
sender().sendMessage(C.GREEN + "Opening studio for the \"Overworld\" pack (seed: 1337)");
Iris.service(StudioSVC.class).open(sender(), 1337, "overworld");
}

@Decree(description = "Set aura spins")
public void aura(
@Param(description = "The h color value", defaultValue = "-20")
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/volmit/iris/core/tools/IrisCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public World create() throws IrisException {
throw new IrisException("Dimension cannot be found null for id " + dimension());
}

if(sender == null)
sender = Iris.getSender();

if(!studio()) {
Iris.service(StudioSVC.class).installIntoWorld(sender, d.getLoadKey(), new File(name()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.MultipleFacing;
import org.bukkit.block.data.type.PointedDripstone;

public class IrisCeilingDecorator extends IrisEngineDecorator {
Expand All @@ -39,11 +40,10 @@ public IrisCeilingDecorator(Engine engine) {
@Override
public void decorate(int x, int z, int realX, int realX1, int realX_1, int realZ, int realZ1, int realZ_1, Hunk<BlockData> data, IrisBiome biome, int height, int max) {
IrisDecorator decorator = getDecorator(biome, realX, realZ);

if(decorator != null) {
if(!decorator.isStacking()) {
if(height >= 0 || height < getEngine().getHeight()) {
data.set(x, height, z, decorator.getBlockData100(biome, getRng(), realX, height, realZ, getData()));
data.set(x, height, z, fixFaces(decorator.getBlockData100(biome, getRng(), realX, height, realZ, getData()), realX, height, realZ));
}
} else {
int stack = decorator.getHeight(getRng().nextParallelRNG(Cache.key(realX, realZ)), realX, realZ, getData());
Expand Down Expand Up @@ -98,4 +98,25 @@ public void decorate(int x, int z, int realX, int realX1, int realX_1, int realZ
}
}
}

private BlockData fixFaces(BlockData b, int x, int y, int z) {
Material mat = b.getMaterial();
if(mat == Material.VINE || mat == Material.GLOW_LICHEN) {
MultipleFacing data = (MultipleFacing)b.clone();
boolean found = false;
for(BlockFace f : BlockFace.values()) {
if(!f.isCartesian())
continue;
Material m = getEngine().getMantle().get(x, y, z).getMaterial();
if(m.isSolid()) {
found = true;
data.setFace(f, m.isSolid());
}
}
if(!found)
data.setFace(BlockFace.UP, true);
return data;
}
return b;
}
}
4 changes: 3 additions & 1 deletion src/main/java/com/volmit/iris/util/data/B.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ private static IntSet buildDecorantCache() {
STONE_BUTTON,
WARPED_BUTTON,
TORCH,
SOUL_TORCH
SOUL_TORCH,
GLOW_LICHEN,
VINE
}).forEach((i) -> b.add(i.ordinal()));
b.addAll(foliageCache);

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ libraries:
- bsf:bsf:2.4.0
commands:
iris:
aliases: [ ir, irs ]
aliases: [ ir, irs, i ]
api-version: ${apiversion}
hotload-dependencies: false
softdepend: [ "Oraxen", "ItemsAdder", "IrisFeller", "WorldEdit", "PlaceholderAPI"]

0 comments on commit 1cb2ea6

Please sign in to comment.