aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorGTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com>2023-01-10 06:07:45 +0000
committerGTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com>2023-01-10 06:07:45 +0000
commitb2e192f5b2e4e1cd24fcf157fc20aa1e128daa46 (patch)
tree4ae70d90884083ae327d42a50075c4053ca8a4d9 /src/main/java/com
parent3ed20b0a16f24518e9c01a8d96f5b36b05dca9d0 (diff)
downloadGT5-Unofficial-b2e192f5b2e4e1cd24fcf157fc20aa1e128daa46.tar.gz
GT5-Unofficial-b2e192f5b2e4e1cd24fcf157fc20aa1e128daa46.tar.bz2
GT5-Unofficial-b2e192f5b2e4e1cd24fcf157fc20aa1e128daa46.zip
Spotless + survival construction enabled
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java18
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java12
2 files changed, 24 insertions, 6 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java
index 6d6e91b348..1d16bef0fb 100644
--- a/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java
+++ b/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java
@@ -1,8 +1,6 @@
package com.github.technus.tectech.thing.block;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Random;
+import java.util.*;
import java.util.stream.IntStream;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
@@ -113,6 +111,18 @@ public class TileEyeOfHarmony extends TileEntity {
}
private final ArrayList<OrbitingObject> orbitingObjects = new ArrayList<>();
+ private static final Set<String> BLACKLISTED_BLOCKS =
+ Collections.unmodifiableSet(new HashSet<>(Arrays.asList("Tf", "Ow", "ED", "EA", "VA")));
+ // Map of strings to blocks
+ private static final Map<String, Block> BLOCKS;
+
+ static {
+ // Initialize the map of blocks
+ BLOCKS = ModBlocks.blocks;
+
+ // Remove blacklisted blocks from the map
+ BLOCKS.keySet().removeAll(BLACKLISTED_BLOCKS);
+ }
private static final float maxAngle = 30;
@@ -120,7 +130,7 @@ public class TileEyeOfHarmony extends TileEntity {
public void generateImportantInfo() {
int index = 0;
- for (Block block : selectNRandomElements(ModBlocks.blocks.values(), tier + 1)) {
+ for (Block block : selectNRandomElements(BLOCKS.values(), tier + 1)) {
float xAngle = generateRandomFloat(-maxAngle, maxAngle);
float zAngle = generateRandomFloat(-maxAngle, maxAngle);
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java
index c7977ff569..8f8fb20d07 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java
@@ -24,6 +24,8 @@ import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.util.ItemStackLong;
import com.google.common.collect.ImmutableList;
import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
+import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -42,6 +44,7 @@ import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_Output_ME;
import java.util.*;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -52,7 +55,7 @@ import org.spongepowered.libraries.com.google.common.math.LongMath;
@SuppressWarnings("SpellCheckingInspection")
public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_MultiblockBase_EM
- implements IConstructable, IGlobalWirelessEnergy {
+ implements IConstructable, IGlobalWirelessEnergy, ISurvivalConstructable {
private static final boolean EOHDebugMode = true;
@@ -70,6 +73,12 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl
private String userName = "";
private long euOutput = 0;
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece("main", stackSize, 16, 16, 0, elementBudget, source, actor, false, true);
+ }
+
// Multiblock structure.
private static final IStructureDefinition<GT_MetaTileEntity_EM_EyeOfHarmony> STRUCTURE_DEFINITION =
IStructureDefinition.<GT_MetaTileEntity_EM_EyeOfHarmony>builder()
@@ -1614,7 +1623,6 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
-
structureBuild_EM("main", 16, 16, 0, stackSize, hintsOnly);
}