Updated FabricBlockSettings

This commit is contained in:
drcrazy 2020-06-09 17:02:06 +03:00
parent c3d405e4f4
commit 4e17c87ca4
16 changed files with 33 additions and 53 deletions

View file

@ -26,7 +26,7 @@ package techreborn.blocks.generator;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
@ -53,7 +53,7 @@ import java.util.List;
public class BlockFusionCoil extends Block {
public BlockFusionCoil() {
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).sounds(BlockSoundGroup.METAL).build());
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).sounds(BlockSoundGroup.METAL));
}
@Override

View file

@ -24,7 +24,7 @@
package techreborn.blocks.lighting;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.EntityContext;
@ -61,7 +61,7 @@ public class BlockLamp extends BaseBlockEntityProvider {
private static int brightness = 15;
public BlockLamp(int cost, double depth, double width) {
super(FabricBlockSettings.of(Material.REDSTONE_LAMP).strength(2f, 2f).lightLevel(brightness).build());
super(FabricBlockSettings.of(Material.REDSTONE_LAMP).strength(2f, 2f).lightLevel(brightness));
this.shape = genCuboidShapes(depth, width);
this.cost = cost;
this.setDefaultState(this.getStateManager().getDefaultState().with(FACING, Direction.NORTH).with(ACTIVE, false));

View file

@ -24,7 +24,7 @@
package techreborn.blocks.misc;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
@ -39,7 +39,7 @@ public class BlockMachineCasing extends BlockMultiblockBase {
public final int heatCapacity;
public BlockMachineCasing(int heatCapacity) {
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).sounds(BlockSoundGroup.METAL).build());
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).sounds(BlockSoundGroup.METAL));
this.heatCapacity = heatCapacity;
}

View file

@ -24,7 +24,7 @@
package techreborn.blocks.misc;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Material;
import net.minecraft.sound.BlockSoundGroup;
import reborncore.common.BaseBlock;
@ -32,6 +32,6 @@ import reborncore.common.BaseBlock;
public class BlockMachineFrame extends BaseBlock {
public BlockMachineFrame() {
super(FabricBlockSettings.of(Material.METAL).strength(1f, 1f).sounds(BlockSoundGroup.METAL).build());
super(FabricBlockSettings.of(Material.METAL).strength(1f, 1f).sounds(BlockSoundGroup.METAL));
}
}

View file

@ -24,7 +24,7 @@
package techreborn.blocks.misc;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.FenceBlock;
import net.minecraft.block.Material;
@ -35,7 +35,7 @@ import net.minecraft.util.math.Direction;
public class BlockRefinedIronFence extends FenceBlock {
public BlockRefinedIronFence() {
super(FabricBlockSettings.of(Material.METAL, MaterialColor.WOOD).strength(2.0F, 3.0F).sounds(BlockSoundGroup.METAL).build());
super(FabricBlockSettings.of(Material.METAL, MaterialColor.WOOD).strength(2.0F, 3.0F).sounds(BlockSoundGroup.METAL));
}
@Override

View file

@ -24,7 +24,7 @@
package techreborn.blocks.misc;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.GlassBlock;
import net.minecraft.block.Material;
import net.minecraft.sound.BlockSoundGroup;
@ -32,7 +32,7 @@ import net.minecraft.sound.BlockSoundGroup;
public class BlockReinforcedGlass extends GlassBlock {
public BlockReinforcedGlass() {
super(FabricBlockSettings.of(Material.GLASS).strength(4f, 60f).sounds(BlockSoundGroup.STONE).nonOpaque().build());
super(FabricBlockSettings.of(Material.GLASS).strength(4f, 60f).sounds(BlockSoundGroup.STONE).nonOpaque());
}
}

View file

@ -24,7 +24,7 @@
package techreborn.blocks.misc;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Blocks;
import net.minecraft.block.FireBlock;
import net.minecraft.block.LeavesBlock;
@ -34,7 +34,7 @@ import net.minecraft.sound.BlockSoundGroup;
public class BlockRubberLeaves extends LeavesBlock {
public BlockRubberLeaves() {
super(FabricBlockSettings.of(Material.LEAVES).hardness(0.2F).ticksRandomly().sounds(BlockSoundGroup.GRASS).build().nonOpaque());
super(FabricBlockSettings.of(Material.LEAVES).hardness(0.2F).ticksRandomly().sounds(BlockSoundGroup.GRASS).nonOpaque());
((FireBlock) Blocks.FIRE).registerFlammableBlock(this, 30, 60);
}

View file

@ -24,24 +24,14 @@
package techreborn.blocks.misc;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.FireBlock;
import net.minecraft.block.LogBlock;
import net.minecraft.block.Material;
import net.minecraft.block.MaterialColor;
import net.minecraft.block.PillarBlock;
import net.minecraft.entity.LivingEntity;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.AxeItem;
import net.minecraft.item.ItemStack;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.DirectionProperty;
@ -73,7 +63,7 @@ public class BlockRubberLog extends LogBlock {
public static BooleanProperty HAS_SAP = BooleanProperty.of("hassap");
public BlockRubberLog() {
super(MaterialColor.SPRUCE, FabricBlockSettings.of(Material.WOOD, MaterialColor.BROWN).strength(2.0F, 2f).sounds(BlockSoundGroup.WOOD).ticksRandomly().build());
super(MaterialColor.SPRUCE, FabricBlockSettings.of(Material.WOOD, MaterialColor.BROWN).strength(2.0F, 2f).sounds(BlockSoundGroup.WOOD).ticksRandomly());
this.setDefaultState(this.getDefaultState().with(SAP_SIDE, Direction.NORTH).with(HAS_SAP, false).with(AXIS, Direction.Axis.Y));
((FireBlock) Blocks.FIRE).registerFlammableBlock(this, 5, 5);
}

View file

@ -24,7 +24,7 @@
package techreborn.blocks.misc;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.FireBlock;
@ -37,7 +37,7 @@ import net.minecraft.sound.BlockSoundGroup;
public class BlockRubberPlank extends Block {
public BlockRubberPlank() {
super(FabricBlockSettings.of(Material.WOOD).strength(2f, 2f).sounds(BlockSoundGroup.WOOD).build());
super(FabricBlockSettings.of(Material.WOOD).strength(2f, 2f).sounds(BlockSoundGroup.WOOD));
((FireBlock) Blocks.FIRE).registerFlammableBlock(this, 5, 20);
}
}

View file

@ -24,7 +24,7 @@
package techreborn.blocks.misc;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Material;
import net.minecraft.block.SaplingBlock;
import net.minecraft.sound.BlockSoundGroup;
@ -36,6 +36,6 @@ import techreborn.world.RubberSaplingGenerator;
public class BlockRubberSapling extends SaplingBlock {
public BlockRubberSapling() {
super(new RubberSaplingGenerator(), FabricBlockSettings.of(Material.PLANT).sounds(BlockSoundGroup.GRASS).noCollision().ticksRandomly().breakInstantly().build());
super(new RubberSaplingGenerator(), FabricBlockSettings.of(Material.PLANT).sounds(BlockSoundGroup.GRASS).noCollision().ticksRandomly().breakInstantly());
}
}

View file

@ -24,7 +24,7 @@
package techreborn.blocks.misc;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Material;
import net.minecraft.sound.BlockSoundGroup;
import reborncore.common.BaseBlock;
@ -32,16 +32,6 @@ import reborncore.common.BaseBlock;
public class BlockStorage extends BaseBlock {
public BlockStorage() {
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).sounds(BlockSoundGroup.METAL).build());
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).sounds(BlockSoundGroup.METAL));
}
// public static ItemStack getStorageBlockByName(String name, int count) {
// for (int i = 0; i < types.length; i++) {
// if (types[i].equals(name)) {
// return new ItemStack(ModBlocks.STORAGE, count, i);
// }
// }
// return BlockStorage2.getStorageBlockByName(name, count);
// }
}

View file

@ -24,7 +24,7 @@
package techreborn.blocks.storage.energy;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
@ -60,7 +60,7 @@ public abstract class EnergyStorageBlock extends BaseBlockEntityProvider {
public IMachineGuiHandler gui;
public EnergyStorageBlock(String name, IMachineGuiHandler gui) {
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).build());
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f));
this.setDefaultState(this.getStateManager().getDefaultState().with(FACING, Direction.NORTH));
this.name = name;
this.gui = gui;

View file

@ -24,7 +24,7 @@
package techreborn.blocks.storage.energy;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
@ -49,7 +49,7 @@ import techreborn.blockentity.storage.energy.lesu.LSUStorageBlockEntity;
public class LSUStorageBlock extends BaseBlockEntityProvider {
public LSUStorageBlock() {
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).build());
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f));
BlockWrenchEventHandler.wrenableBlocks.add(this);
}

View file

@ -24,7 +24,7 @@
package techreborn.blocks.transformers;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
@ -55,7 +55,7 @@ public abstract class BlockTransformer extends BaseBlockEntityProvider {
public String name;
public BlockTransformer(String name) {
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).build());
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f));
this.setDefaultState(this.getStateManager().getDefaultState().with(FACING, Direction.NORTH));
this.name = name;
BlockWrenchEventHandler.wrenableBlocks.add(this);

View file

@ -24,7 +24,7 @@
package techreborn.init;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Material;
import net.minecraft.block.OreBlock;
@ -432,7 +432,7 @@ public class TRContent {
Ores(int veinSize, int veinsPerChunk, int minY, int maxY) {
name = this.toString().toLowerCase(Locale.ROOT);
block = new OreBlock(FabricBlockSettings.of(Material.STONE).strength(2f, 2f).build());
block = new OreBlock(FabricBlockSettings.of(Material.STONE).strength(2f, 2f));
this.veinSize = veinSize;
this.veinsPerChunk = veinsPerChunk;
this.minY = minY;

View file

@ -24,7 +24,7 @@
package techreborn.utils;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Block.Settings;
import net.minecraft.block.Material;
@ -75,7 +75,7 @@ public class InitUtils {
settings.noCollision();
}
return settings.build();
return settings;
}
public static Settings setupRubberBlockSettings(float hardness, float resistance) {