mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 22:31:52 +00:00
create MutatedStructure
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
|||||||
|
package com.dfsek.terra.addons.structure.mutator;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.registry.key.Keyed;
|
||||||
|
import com.dfsek.terra.api.registry.key.RegistryKey;
|
||||||
|
import com.dfsek.terra.api.structure.Structure;
|
||||||
|
import com.dfsek.terra.api.util.Rotation;
|
||||||
|
import com.dfsek.terra.api.util.vector.Vector3Int;
|
||||||
|
import com.dfsek.terra.api.world.WritableWorld;
|
||||||
|
import com.dfsek.terra.api.world.util.ReadInterceptor;
|
||||||
|
import com.dfsek.terra.api.world.util.WriteInterceptor;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
||||||
|
public class MutatedStructure implements Structure, Keyed<MutatedStructure> {
|
||||||
|
private final RegistryKey key;
|
||||||
|
private final Structure base;
|
||||||
|
private final ReadInterceptor readInterceptor;
|
||||||
|
private final WriteInterceptor writeInterceptor;
|
||||||
|
|
||||||
|
public MutatedStructure(RegistryKey key, Structure base,
|
||||||
|
ReadInterceptor readInterceptor, WriteInterceptor writeInterceptor) {
|
||||||
|
this.key = key;
|
||||||
|
this.base = base;
|
||||||
|
this.readInterceptor = readInterceptor;
|
||||||
|
this.writeInterceptor = writeInterceptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RegistryKey getRegistryKey() {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean generate(Vector3Int location, WritableWorld world, Random random, Rotation rotation) {
|
||||||
|
return base.generate(location,
|
||||||
|
world
|
||||||
|
.buffer()
|
||||||
|
.read(readInterceptor)
|
||||||
|
.write(writeInterceptor)
|
||||||
|
.build(),
|
||||||
|
random, rotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
package com.dfsek.terra.addons.structure.mutator;
|
||||||
|
|
||||||
|
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
|
||||||
|
import com.dfsek.terra.api.Platform;
|
||||||
|
import com.dfsek.terra.api.addon.BaseAddon;
|
||||||
|
import com.dfsek.terra.api.inject.annotations.Inject;
|
||||||
|
|
||||||
|
|
||||||
|
public class StructureMutatorAddon implements AddonInitializer {
|
||||||
|
@Inject
|
||||||
|
private Platform platform;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private BaseAddon addon;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user