mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Merge remote-tracking branch 'upstream/master' into DecreeCommands
This commit is contained in:
commit
ce60c048f8
@ -31,10 +31,7 @@ import com.volmit.iris.engine.actuator.IrisTerrainNormalActuator;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.framework.*;
|
||||
import com.volmit.iris.engine.mantle.EngineMantle;
|
||||
import com.volmit.iris.engine.modifier.IrisCaveModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisDepositModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisPostModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisRavineModifier;
|
||||
import com.volmit.iris.engine.modifier.*;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiomePaletteLayer;
|
||||
import com.volmit.iris.engine.object.decoration.IrisDecorator;
|
||||
|
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object.cave;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.basic.IrisRange;
|
||||
import com.volmit.iris.engine.object.common.IRare;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisNoiseGenerator;
|
||||
import com.volmit.iris.engine.object.noise.IrisStyledRange;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.util.noise.Worm;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Desc("Generate worms")
|
||||
@Data
|
||||
public class IrisWormGenerator implements IRare {
|
||||
@Required
|
||||
@Desc("Typically a 1 in RARITY on a per chunk basis")
|
||||
@MinNumber(1)
|
||||
private int rarity = 15;
|
||||
|
||||
@Desc("The style used to determine the curvature of this worm")
|
||||
private IrisGeneratorStyle angleStyle = new IrisGeneratorStyle();
|
||||
|
||||
@Desc("The max block distance this worm can travel from its start. This can have performance implications at ranges over 1,000 blocks but it's not too serious, test.")
|
||||
private int maxDistance = 128;
|
||||
|
||||
@Desc("The max segments, or iterations this worm can execute on. Setting this to -1 will allow it to run up to the maxDistance's value of iterations (default)")
|
||||
private int maxSegments = -1;
|
||||
|
||||
@Desc("The thickness of the worm over distance")
|
||||
private IrisStyledRange girth = new IrisStyledRange().setMin(3).setMax(7)
|
||||
.setStyle(new IrisGeneratorStyle(NoiseStyle.SIMPLEX));
|
||||
}
|
43
src/main/java/com/volmit/iris/util/noise/Worm.java
Normal file
43
src/main/java/com/volmit/iris/util/noise/Worm.java
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util.noise;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Worm {
|
||||
private double position;
|
||||
private double velocity;
|
||||
|
||||
public Worm(double startPosition, double startVelocity)
|
||||
{
|
||||
this.position = startPosition;
|
||||
this.velocity = startVelocity;
|
||||
}
|
||||
|
||||
public void unstep()
|
||||
{
|
||||
position -= velocity;
|
||||
}
|
||||
|
||||
public void step()
|
||||
{
|
||||
position += velocity;
|
||||
}
|
||||
}
|
52
src/main/java/com/volmit/iris/util/noise/Worm2.java
Normal file
52
src/main/java/com/volmit/iris/util/noise/Worm2.java
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util.noise;
|
||||
|
||||
import com.volmit.iris.util.math.Position2;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Worm2
|
||||
{
|
||||
private final Worm x;
|
||||
private final Worm z;
|
||||
|
||||
public Worm2(Worm x, Worm z)
|
||||
{
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public Worm2(int x, int z, int vx, int vz)
|
||||
{
|
||||
this(new Worm(x, vx), new Worm(z, vz));
|
||||
}
|
||||
|
||||
public void step()
|
||||
{
|
||||
x.step();
|
||||
z.step();
|
||||
}
|
||||
|
||||
public void unstep()
|
||||
{
|
||||
x.unstep();
|
||||
z.unstep();
|
||||
}
|
||||
}
|
55
src/main/java/com/volmit/iris/util/noise/Worm3.java
Normal file
55
src/main/java/com/volmit/iris/util/noise/Worm3.java
Normal file
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util.noise;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Worm3
|
||||
{
|
||||
private final Worm x;
|
||||
private final Worm y;
|
||||
private final Worm z;
|
||||
|
||||
public Worm3(Worm x,Worm y, Worm z)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public Worm3(int x, int y, int z, int vx, int vy, int vz)
|
||||
{
|
||||
this(new Worm(x, vx), new Worm(y, vy), new Worm(z, vz));
|
||||
}
|
||||
|
||||
public void step()
|
||||
{
|
||||
x.step();
|
||||
y.step();
|
||||
z.step();
|
||||
}
|
||||
|
||||
public void unstep()
|
||||
{
|
||||
x.unstep();
|
||||
y.unstep();
|
||||
z.unstep();
|
||||
}
|
||||
}
|
51
src/main/java/com/volmit/iris/util/noise/WormIterator2.java
Normal file
51
src/main/java/com/volmit/iris/util/noise/WormIterator2.java
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util.noise;
|
||||
|
||||
import com.volmit.iris.util.function.NoiseProvider;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Builder
|
||||
@Data
|
||||
public class WormIterator2 {
|
||||
private transient Worm2 worm;
|
||||
private int x;
|
||||
private int z;
|
||||
private int maxDistance;
|
||||
private int maxIterations;
|
||||
|
||||
public boolean hasNext()
|
||||
{
|
||||
double dist = maxDistance - (Math.max(Math.abs(worm.getX().getVelocity()), Math.abs(worm.getZ().getVelocity())) + 1);
|
||||
return maxIterations > 0 &&
|
||||
((x * x) - (worm.getX().getPosition() * worm.getX().getPosition()))
|
||||
+ ((z * z) - (worm.getZ().getPosition() * worm.getZ().getPosition())) < dist * dist;
|
||||
}
|
||||
|
||||
public Worm2 next(NoiseProvider p)
|
||||
{
|
||||
if(worm == null)
|
||||
{
|
||||
worm = new Worm2(x, z, 0, 0);
|
||||
}
|
||||
|
||||
return worm;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user