it compiles :D

This commit is contained in:
modmuss50 2019-06-12 19:29:04 +01:00
parent 500ff29dbd
commit 6b9f6cb4f8
142 changed files with 755 additions and 1724 deletions

View file

@ -160,18 +160,10 @@ public class BlockAlarm extends BaseTileBlock {
return BlockRenderType.MODEL;
}
@Override
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public void buildTooltip(ItemStack stack, @Nullable BlockView worldIn, List<Component> tooltip, TooltipContext flagIn) {
tooltip.add(new TranslatableComponent("techreborn.tooltip.alarm").applyFormat(ChatFormat.GRAY));
}
@Override
public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos) {
return shape[getFacing(state).getId()];
}
}

View file

@ -33,7 +33,6 @@ import net.minecraft.util.BlockRotation;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
import reborncore.api.ToolManager;
import reborncore.api.tile.IMachineGuiHandler;

View file

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

View file

@ -24,7 +24,7 @@
package techreborn.blocks;
import net.minecraft.block.Block;
import net.fabricmc.fabric.api.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(Block.Settings.of(Material.METAL).strength(1f).sounds(BlockSoundGroup.METAL));
super(FabricBlockSettings.of(Material.METAL).strength(1f, 1f).sounds(BlockSoundGroup.METAL).build());
}
}

View file

@ -26,6 +26,7 @@ package techreborn.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
@ -86,26 +87,26 @@ public class BlockNuke extends BaseBlock {
}
if (entityarrow.isOnFire()) {
ignite(worldIn, pos, state, shooter);
worldIn.removeBlock(pos);
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState());
}
}
}
@SuppressWarnings("deprecation")
@Override
public void onBlockAdded(BlockState state, World worldIn, BlockPos pos, BlockState oldState) {
super.onBlockAdded(state, worldIn, pos, oldState);
public void onBlockAdded(BlockState state, World worldIn, BlockPos pos, BlockState oldState, boolean b) {
super.onBlockAdded(state, worldIn, pos, oldState, b);
if (worldIn.isReceivingRedstonePower(pos)) {
ignite(worldIn, pos, state, null);
worldIn.removeBlock(pos);
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState());
}
}
@Override
public void neighborChanged(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos p_189540_5_) {
public void neighborUpdate(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos p_189540_5_, boolean bo) {
if (worldIn.isReceivingRedstonePower(pos)) {
ignite(worldIn, pos, state, null);
worldIn.removeBlock(pos);
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState());
}
}

View file

@ -24,6 +24,7 @@
package techreborn.blocks;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
@ -68,37 +69,38 @@ public class BlockOre extends Block {
public static int sphaleriteMaxQuantity = 2;
public BlockOre() {
super(Block.Settings.of(Material.STONE).strength(2f));
super(FabricBlockSettings.of(Material.STONE).strength(2f, 2f).build());
}
@Override
public void getDrops(BlockState state, DefaultedList<ItemStack> drops, World world, BlockPos pos, int fortune) {
Block ore = state.getBlock();
Random random = new Random();
// Secondary drop, like Yellow Garnet from Sphalerite ore added via event handler.
if (ore == TRContent.Ores.RUBY.block) {
OreDrop ruby = new OreDrop(TRContent.Gems.RUBY.getStack(rubyMinQuatity), rubyMaxQuantity);
drops.add(ruby.getDrops(fortune, random));
} else if (ore == TRContent.Ores.SAPPHIRE.block) {
OreDrop sapphire = new OreDrop(TRContent.Gems.SAPPHIRE.getStack(sapphireMinQuantity), sapphireMaxQuantity);
drops.add(sapphire.getDrops(fortune, random));
} else if (ore == TRContent.Ores.PYRITE.block) {
OreDrop pyriteDust = new OreDrop(TRContent.Dusts.PYRITE.getStack(pyriteMinQuatity), pyriteMaxQuantity);
drops.add(pyriteDust.getDrops(fortune, random));
} else if (ore == TRContent.Ores.SODALITE.block) {
OreDrop sodalite = new OreDrop(TRContent.Dusts.SODALITE.getStack(sodaliteMinQuatity), sodaliteMaxQuantity);
drops.add(sodalite.getDrops(fortune, random));
} else if (ore == TRContent.Ores.CINNABAR.block) {
OreDrop cinnabar = new OreDrop(TRContent.Dusts.CINNABAR.getStack(cinnabarMinQuatity), cinnabarMaxQuantity);
drops.add(cinnabar.getDrops(fortune, random));
} else if (ore == TRContent.Ores.SPHALERITE.block) {
OreDrop sphalerite = new OreDrop(TRContent.Dusts.SPHALERITE.getStack(sphaleriteMinQuatity), sphaleriteMaxQuantity);
drops.add(sphalerite.getDrops(fortune, random));
} else {
drops.add(new ItemStack(this));
}
return;
}
//TODO move to json
// @Override
// public void getDrops(BlockState state, DefaultedList<ItemStack> drops, World world, BlockPos pos, int fortune) {
// Block ore = state.getBlock();
// Random random = new Random();
//
// // Secondary drop, like Yellow Garnet from Sphalerite ore added via event handler.
// if (ore == TRContent.Ores.RUBY.block) {
// OreDrop ruby = new OreDrop(TRContent.Gems.RUBY.getStack(rubyMinQuatity), rubyMaxQuantity);
// drops.add(ruby.getDrops(fortune, random));
// } else if (ore == TRContent.Ores.SAPPHIRE.block) {
// OreDrop sapphire = new OreDrop(TRContent.Gems.SAPPHIRE.getStack(sapphireMinQuantity), sapphireMaxQuantity);
// drops.add(sapphire.getDrops(fortune, random));
// } else if (ore == TRContent.Ores.PYRITE.block) {
// OreDrop pyriteDust = new OreDrop(TRContent.Dusts.PYRITE.getStack(pyriteMinQuatity), pyriteMaxQuantity);
// drops.add(pyriteDust.getDrops(fortune, random));
// } else if (ore == TRContent.Ores.SODALITE.block) {
// OreDrop sodalite = new OreDrop(TRContent.Dusts.SODALITE.getStack(sodaliteMinQuatity), sodaliteMaxQuantity);
// drops.add(sodalite.getDrops(fortune, random));
// } else if (ore == TRContent.Ores.CINNABAR.block) {
// OreDrop cinnabar = new OreDrop(TRContent.Dusts.CINNABAR.getStack(cinnabarMinQuatity), cinnabarMaxQuantity);
// drops.add(cinnabar.getDrops(fortune, random));
// } else if (ore == TRContent.Ores.SPHALERITE.block) {
// OreDrop sphalerite = new OreDrop(TRContent.Dusts.SPHALERITE.getStack(sphaleriteMinQuatity), sphaleriteMaxQuantity);
// drops.add(sphalerite.getDrops(fortune, random));
// } else {
// drops.add(new ItemStack(this));
// }
//
// return;
// }
}

View file

@ -24,7 +24,7 @@
package techreborn.blocks;
import net.minecraft.block.Block;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.FenceBlock;
import net.minecraft.block.Material;
import net.minecraft.block.MaterialColor;
@ -33,6 +33,6 @@ import net.minecraft.sound.BlockSoundGroup;
public class BlockRefinedIronFence extends FenceBlock {
public BlockRefinedIronFence() {
super(Block.Settings.of(Material.METAL, MaterialColor.WOOD).strength(2.0F, 3.0F).sounds(BlockSoundGroup.METAL));
super(FabricBlockSettings.of(Material.METAL, MaterialColor.WOOD).strength(2.0F, 3.0F).sounds(BlockSoundGroup.METAL).build());
}
}

View file

@ -25,8 +25,6 @@
package techreborn.blocks;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.GlassBlock;
import net.minecraft.block.Material;
import net.minecraft.sound.BlockSoundGroup;
@ -34,8 +32,6 @@ import reborncore.client.models.ModelCompound;
import reborncore.client.models.RebornModelRegistry;
import techreborn.TechReborn;
import java.util.Random;
public class BlockReinforcedGlass extends GlassBlock {
public BlockReinforcedGlass() {

View file

@ -25,31 +25,21 @@
package techreborn.blocks;
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.LeavesBlock;
import net.minecraft.block.Material;
import net.minecraft.item.ItemConvertible;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.client.models.ModelCompound;
import reborncore.client.models.RebornModelRegistry;
import techreborn.TechReborn;
import techreborn.init.TRContent;
public class BlockRubberLeaves extends LeavesBlock {
public BlockRubberLeaves() {
super(FabricBlockSettings.of(Material.LEAVES).hardness(0.2F).ticksRandomly().sounds(BlockSoundGroup.GRASS).build());
((FireBlock) Blocks.FIRE).registerFlammableBlock(this, 30, 60);
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, EnvTypeANCE, PERSISTENT));
}
@Override
public ItemConvertible getItemDropped(BlockState state, World worldIn, BlockPos pos, int fortune) {
return TRContent.RUBBER_SAPLING;
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, DISTANCE, PERSISTENT));
}
}

View file

@ -24,13 +24,8 @@
package techreborn.blocks;
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.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.server.network.ServerPlayerEntity;
@ -61,6 +56,7 @@ import techreborn.items.tool.ItemTreeTap;
import techreborn.items.tool.basic.ItemElectricTreetap;
import java.util.Random;
import java.util.function.Consumer;
/**
* Created by modmuss50 on 19/02/2016.
@ -71,7 +67,7 @@ public class BlockRubberLog extends LogBlock {
public static BooleanProperty HAS_SAP = BooleanProperty.create("hassap");
public BlockRubberLog() {
super(MaterialColor.SPRUCE, Block.Settings.of(Material.WOOD, MaterialColor.BROWN).strength(2.0F).sounds(BlockSoundGroup.WOOD).ticksRandomly());
super(MaterialColor.SPRUCE, FabricBlockSettings.of(Material.WOOD, MaterialColor.BROWN).strength(2.0F, 2f).sounds(BlockSoundGroup.WOOD).ticksRandomly().build());
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);
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this));
@ -146,7 +142,7 @@ public class BlockRubberLog extends LogBlock {
ExternalPowerSystems.requestEnergyFromArmor(capEnergy, playerIn);
} else {
playerIn.getStackInHand(Hand.MAIN_HAND).damageItem(1, playerIn);
playerIn.getStackInHand(Hand.MAIN_HAND).applyDamage(1, playerIn, playerEntity -> {});
}
if (!playerIn.inventory.insertStack(TRContent.Parts.SAP.getStack())) {
WorldUtils.dropItem(TRContent.Parts.SAP.getStack(), worldIn, pos.offset(hitResult.getSide()));
@ -161,13 +157,13 @@ public class BlockRubberLog extends LogBlock {
return false;
}
@Override
public void getDrops(BlockState state, DefaultedList<ItemStack> drops, World world, BlockPos pos, int fortune) {
drops.add(new ItemStack(this));
if (state.get(HAS_SAP)) {
if (new Random().nextInt(4) == 0) {
drops.add(TRContent.Parts.SAP.getStack());
}
}
}
// @Override
// public void getDrops(BlockState state, DefaultedList<ItemStack> drops, World world, BlockPos pos, int fortune) {
// drops.add(new ItemStack(this));
// if (state.get(HAS_SAP)) {
// if (new Random().nextInt(4) == 0) {
// drops.add(TRContent.Parts.SAP.getStack());
// }
// }
// }
}

View file

@ -24,6 +24,7 @@
package techreborn.blocks;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.FireBlock;
@ -39,7 +40,7 @@ import techreborn.TechReborn;
public class BlockRubberPlank extends Block {
public BlockRubberPlank() {
super(Block.Settings.of(Material.WOOD).strength(2f).sounds(BlockSoundGroup.WOOD));
super(FabricBlockSettings.of(Material.WOOD).strength(2f, 2f).sounds(BlockSoundGroup.WOOD).build());
((FireBlock) Blocks.FIRE).registerFlammableBlock(this, 5, 20);
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this));
}

View file

@ -24,6 +24,7 @@
package techreborn.blocks;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Material;
import net.minecraft.block.MaterialColor;
@ -36,7 +37,7 @@ import techreborn.TechReborn;
public class BlockRubberPlankSlab extends SlabBlock {
public BlockRubberPlankSlab() {
super(Block.Settings.of(Material.WOOD, MaterialColor.SPRUCE).strength(2.0F, 15.0F).sounds(BlockSoundGroup.WOOD));
super(FabricBlockSettings.of(Material.WOOD, MaterialColor.SPRUCE).strength(2.0F, 15.0F).sounds(BlockSoundGroup.WOOD).build());
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this));
}
}

View file

@ -24,7 +24,7 @@
package techreborn.blocks;
import net.minecraft.block.Block;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.Material;
import net.minecraft.block.SaplingBlock;
import net.minecraft.sound.BlockSoundGroup;
@ -35,6 +35,6 @@ import net.minecraft.sound.BlockSoundGroup;
public class BlockRubberSapling extends SaplingBlock {
public BlockRubberSapling() {
super(new RubberTree(), Block.Settings.of(Material.PLANT).sounds(BlockSoundGroup.GRASS));
super(new RubberTree(), FabricBlockSettings.of(Material.PLANT).sounds(BlockSoundGroup.GRASS).build());
}
}

View file

@ -24,7 +24,7 @@
package techreborn.blocks;
import net.minecraft.block.Block;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.Material;
import net.minecraft.sound.BlockSoundGroup;
import reborncore.common.BaseBlock;
@ -32,7 +32,7 @@ import reborncore.common.BaseBlock;
public class BlockStorage extends BaseBlock {
public BlockStorage() {
super(Block.Settings.of(Material.METAL).strength(2f).sounds(BlockSoundGroup.METAL));
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).sounds(BlockSoundGroup.METAL).build());
}
// public static ItemStack getStorageBlockByName(String name, int count) {

View file

@ -1,43 +1,50 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2018 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.blocks;
import java.util.Random;
import net.minecraft.block.sapling.SaplingGenerator;
import net.minecraft.world.gen.feature.AbstractTreeFeature;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import techreborn.world.feature.RubberTreeFeature;
/**
* @author drcrazy
*
*/
public class RubberTree extends SaplingGenerator {
@Override
protected AbstractTreeFeature<DefaultFeatureConfig> createTreeFeature(Random random) {
return new RubberTreeFeature();
}
}
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2018 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.blocks;
import net.minecraft.block.sapling.SaplingGenerator;
import net.minecraft.world.gen.feature.AbstractTreeFeature;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import javax.annotation.Nullable;
import java.util.Random;
/**
* @author drcrazy
*
*/
public class RubberTree extends SaplingGenerator {
@Nullable
@Override
protected AbstractTreeFeature<DefaultFeatureConfig> createTreeFeature(Random random) {
return null;
}
// @Override
// protected AbstractTreeFeature<DefaultFeatureConfig> createTreeFeature(Random random) {
// return new RubberTreeFeature();
// }
}

View file

@ -24,11 +24,7 @@
package techreborn.blocks.cable;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.Material;
import net.minecraft.block.*;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;

View file

@ -1,37 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2018 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.blocks.fluid;
import net.minecraft.util.Identifier;
public class TechRebornFluid extends Fluid {
public TechRebornFluid(String fluidName) {
super(fluidName,
new Identifier("techreborn:blocks/fluids/" + fluidName.replaceFirst("fluid", "") + "_flowing"),
new Identifier("techreborn:blocks/fluids/" + fluidName.replaceFirst("fluid", "") + "_flowing"));
//FluidRegistry.addBucketForFluid(this);
}
}

View file

@ -24,6 +24,9 @@
package techreborn.blocks.generator;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
@ -38,11 +41,8 @@ import net.minecraft.sound.SoundCategory;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import reborncore.api.ToolManager;
import reborncore.client.models.ModelCompound;
import reborncore.client.models.RebornModelRegistry;
@ -55,7 +55,7 @@ import java.util.List;
public class BlockFusionCoil extends Block {
public BlockFusionCoil() {
super(Block.Settings.of(Material.METAL).strength(2f).sounds(BlockSoundGroup.METAL));
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).sounds(BlockSoundGroup.METAL).build());
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/generators"));
}
@ -65,7 +65,7 @@ public class BlockFusionCoil extends Block {
ItemStack tool = playerIn.getStackInHand(Hand.MAIN_HAND);
if (!tool.isEmpty() && ToolManager.INSTANCE.canHandleTool(tool)) {
if (ToolManager.INSTANCE.handleTool(tool, pos, worldIn, playerIn, side, false)) {
if (ToolManager.INSTANCE.handleTool(tool, pos, worldIn, playerIn, hitResult.getSide(), false)) {
if (playerIn.isSneaking()) {
ItemStack drop = new ItemStack(this);
dropStack(worldIn, pos, drop);

View file

@ -31,7 +31,6 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import reborncore.api.tile.IMachineGuiHandler;

View file

@ -24,14 +24,11 @@
package techreborn.blocks.lighting;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderLayer;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemStack;
@ -55,6 +52,8 @@ import reborncore.common.util.WrenchUtils;
import techreborn.TechReborn;
import techreborn.tiles.lighting.TileLamp;
import javax.annotation.Nullable;
public class BlockLamp extends BaseTileBlock {
public static DirectionProperty FACING = Properties.FACING;

View file

@ -24,6 +24,7 @@
package techreborn.blocks.storage;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
@ -57,7 +58,7 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
public IMachineGuiHandler gui;
public BlockEnergyStorage(String name, IMachineGuiHandler gui) {
super(Block.Settings.of(Material.METAL).strength(2f));
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).build());
this.setDefaultState(this.stateFactory.getDefaultState().with(FACING, Direction.NORTH));
this.name = name;
this.gui = gui;

View file

@ -24,6 +24,7 @@
package techreborn.blocks.storage;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
@ -35,7 +36,6 @@ import net.minecraft.util.DefaultedList;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import reborncore.api.ToolManager;
@ -55,7 +55,7 @@ import techreborn.tiles.storage.lesu.TileLSUStorage;
public class BlockLSUStorage extends BaseTileBlock {
public BlockLSUStorage() {
super(Block.Settings.of(Material.METAL).strength(2f));
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).build());
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/energy"));
BlockWrenchEventHandler.wrenableBlocks.add(this);
}

View file

@ -24,6 +24,8 @@
package techreborn.blocks.tier0;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.item.ItemStack;
@ -35,8 +37,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.client.models.ModelCompound;
import reborncore.client.models.RebornModelRegistry;

View file

@ -154,11 +154,6 @@ public class BlockPlayerDetector extends BlockMachineBase {
builder.add(TYPE);
}
@Override
public boolean canConnectRedstone(BlockState state, BlockView world, BlockPos pos, @Nullable Direction side) {
return true;
}
@Override
public boolean emitsRedstonePower(BlockState state) {
return true;

View file

@ -32,7 +32,7 @@ import reborncore.client.models.RebornModelRegistry;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.TechReborn;
import techreborn.client.EGui;
import techreborn.tiles.machine.multiblock.TileEnvTypeillationTower;
import techreborn.tiles.machine.multiblock.TileDistillationTower;
public class BlockDistillationTower extends BlockMachineBase {
@ -43,7 +43,7 @@ public class BlockDistillationTower extends BlockMachineBase {
@Override
public BlockEntity createBlockEntity(BlockView worldIn) {
return new TileEnvTypeillationTower();
return new TileDistillationTower();
}
@Override

View file

@ -24,6 +24,7 @@
package techreborn.blocks.transformers;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
@ -56,7 +57,7 @@ public abstract class BlockTransformer extends BaseTileBlock {
public String name;
public BlockTransformer(String name) {
super(Block.Settings.of(Material.METAL).strength(2f));
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).build());
this.setDefaultState(this.stateFactory.getDefaultState().with(FACING, Direction.NORTH));
this.name = name;
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/energy"));