Fix Structures
All checks were successful
EnergonRelics/pipeline/head This commit looks good

This commit is contained in:
TheBrokenRail 2020-07-25 17:19:10 -04:00
parent 4a1a4e5866
commit 0fb24c7258
4 changed files with 10 additions and 6 deletions

View File

@ -17,5 +17,5 @@ org.gradle.jvmargs = -Xmx1G
modmenu_version = 1.14.5+build.30
cloth_config_version = 4.6.0
autoconfig_version = 3.2.0-unstable
libstructure_version = 1.3
libstructure_version = 1.4.1
roughlyenoughitems_version = 4.10.3

View File

@ -46,7 +46,7 @@ public class BlockBreakerBlockEntity extends EnergyReceiverBlockEntity {
BlockPos targetPos = getPos().offset(getCachedState().get(BlockBreakerBlock.FACING));
BlockState target = Objects.requireNonNull(getWorld()).getBlockState(targetPos);
if (!target.isAir() && (!target.isToolRequired() || HardcodedConfig.BLOCK_BREAKER_ITEM.isEffectiveOn(target))) {
if (!target.isAir() && target.getHardness(getWorld(), targetPos) != -1 && (!target.isToolRequired() || HardcodedConfig.BLOCK_BREAKER_ITEM.isEffectiveOn(target))) {
if (progress >= HardcodedConfig.BLOCK_BREAKER_TIME) {
addAction(new Action(HardcodedConfig.BLOCK_BREAKER_ENERGY_REQUIRED_BREAK, (world, pos, state) -> {
world.createExplosion(null, targetPos.getX() + 0.5d, targetPos.getY() + 0.5d, targetPos.getZ() + 0.5d, 0.5f, Explosion.DestructionType.NONE);

View File

@ -27,6 +27,7 @@ import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.chunk.StructureConfig;
import net.minecraft.world.gen.chunk.StructuresConfig;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.FeatureConfig;
import net.minecraft.world.gen.feature.StructureFeature;
@ -103,13 +104,15 @@ public class StructureGeneratorBlock extends SimpleBlockWithEntity {
@Override
public void register(String name) {
super.register(name + "_generator");
Registry.register(Registry.STRUCTURE_PIECE, new Identifier(EnergonRelics.NAMESPACE, name + "_piece"), piece);
LibStructure.registerStructure(new Identifier(EnergonRelics.NAMESPACE, name), feature, GenerationStep.Feature.UNDERGROUND_STRUCTURES, structureConfig, feature.configure(FeatureConfig.DEFAULT));
}
@SuppressWarnings("SameParameterValue")
private static void create(String name, StructureGeneratorBlockEntity.StructurePartFactory factory, StructureConfig config) {
blocks.put(name, new StructureGeneratorBlock(factory, config));
StructureGeneratorBlock block = new StructureGeneratorBlock(factory, config);
blocks.put(name, block);
Registry.register(Registry.STRUCTURE_PIECE, new Identifier(EnergonRelics.NAMESPACE, name + "_piece"), block.piece);
LibStructure.registerStructure(new Identifier(EnergonRelics.NAMESPACE, name), block.feature, GenerationStep.Feature.UNDERGROUND_STRUCTURES, block.structureConfig, block.feature.configure(FeatureConfig.DEFAULT));
}
public static void register() {

View File

@ -1,6 +1,7 @@
package com.thebrokenrail.energonrelics.mixin;
import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.block.structure.StructureGeneratorBlock;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
@ -18,6 +19,6 @@ public class MixinDefaultBiomeFeatures {
@Inject(at = @At("RETURN"), method = "addDefaultUndergroundStructures")
private static void addDefaultUndergroundStructures(Biome biome, CallbackInfo info) {
//StructureGeneratorBlock.addToBiome(biome);
StructureGeneratorBlock.addToBiome(biome);
}
}