This commit is contained in:
modmuss50 2020-02-12 18:36:01 +00:00
parent b0d3b3b77d
commit dffec285b2
11 changed files with 26 additions and 18 deletions

View file

@ -31,7 +31,7 @@ import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.network.packet.BlockEntityUpdateS2CPacket;
import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;

View file

@ -25,6 +25,7 @@
package techreborn.blocks.misc;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
import net.minecraft.block.Blocks;
import net.minecraft.block.FireBlock;
import net.minecraft.block.LeavesBlock;
@ -35,7 +36,7 @@ public class BlockRubberLeaves extends LeavesBlock {
public BlockRubberLeaves() {
super(FabricBlockSettings.of(Material.LEAVES).hardness(0.2F).ticksRandomly().sounds(BlockSoundGroup.GRASS).build().nonOpaque());
((FireBlock) Blocks.FIRE).registerFlammableBlock(this, 30, 60);
FlammableBlockRegistry.getDefaultInstance().add(this, 30, 60);
}
}

View file

@ -25,6 +25,7 @@
package techreborn.blocks.misc;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
@ -75,7 +76,7 @@ public class BlockRubberLog extends LogBlock {
public BlockRubberLog() {
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);
FlammableBlockRegistry.getDefaultInstance().add(this, 5, 5);
}
@Override

View file

@ -25,6 +25,7 @@
package techreborn.blocks.misc;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.FireBlock;
@ -38,6 +39,6 @@ public class BlockRubberPlank extends Block {
public BlockRubberPlank() {
super(FabricBlockSettings.of(Material.WOOD).strength(2f, 2f).sounds(BlockSoundGroup.WOOD).build());
((FireBlock) Blocks.FIRE).registerFlammableBlock(this, 5, 20);
FlammableBlockRegistry.getDefaultInstance().add(this, 5, 20);
}
}

View file

@ -106,4 +106,9 @@ public enum TRArmorMaterials implements ArmorMaterial {
public float getToughness() {
return toughness;
}
@Override
public float method_24355() {
return 0; //Knockback resitance
}
}

View file

@ -40,8 +40,8 @@ import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.feature.OreFeatureConfig.Target;
import net.minecraft.world.gen.foliage.BlobFoliagePlacer;
import net.minecraft.world.gen.stateprovider.SimpleStateProvider;
import net.minecraft.world.gen.stateprovider.WeightedStateProvider;
import net.minecraft.world.gen.stateprovider.SimpleBlockStateProvider;
import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider;
import reborncore.common.world.CustomOreFeature;
import reborncore.common.world.CustomOreFeatureConfig;
import techreborn.blocks.misc.BlockRubberLog;
@ -77,7 +77,7 @@ public class WorldGenerator {
private static void setupTrees() {
RUBBER_TREE = Registry.register(Registry.FEATURE, new Identifier("techreborn:rubber_tree"), new RubberTreeFeature(BranchedTreeFeatureConfig::deserialize));
WeightedStateProvider logProvider = new WeightedStateProvider();
WeightedBlockStateProvider logProvider = new WeightedBlockStateProvider();
logProvider.addState(TRContent.RUBBER_LOG.getDefaultState(), 10);
Arrays.stream(Direction.values())
@ -90,7 +90,7 @@ public class WorldGenerator {
RUBBER_TREE_CONFIG = new BranchedTreeFeatureConfig.Builder(
logProvider,
new SimpleStateProvider(TRContent.RUBBER_LEAVES.getDefaultState()),
new SimpleBlockStateProvider(TRContent.RUBBER_LEAVES.getDefaultState()),
new BlobFoliagePlacer(2, 0))
.baseHeight(6)
.heightRandA(2)