Blocks moved to TRContent

This commit is contained in:
drcrazy 2018-09-24 15:45:48 +03:00
parent 9f9595f955
commit dd94ff31c9
69 changed files with 614 additions and 603 deletions

View file

@ -34,7 +34,7 @@ import net.minecraftforge.common.IPlantable;
import techreborn.TechReborn;
import techreborn.blocks.BlockRubberLeaves;
import techreborn.blocks.BlockRubberLog;
import techreborn.init.TRBlocks;
import techreborn.init.TRContent;
import java.util.Random;
@ -80,7 +80,7 @@ public class RubberTreeGenerator extends WorldGenerator {
Block baseBlock = baseSate.getBlock();
boolean hasPlacedBlock = false;
if (baseBlock != null && baseBlock.canSustainPlant(baseSate, world, new BlockPos(x, y - 1, z),
EnumFacing.UP, (IPlantable) TRBlocks.RUBBER_SAPLING) && y < worldHeight - treeHeight - 1) {
EnumFacing.UP, (IPlantable) TRContent.RUBBER_SAPLING) && y < worldHeight - treeHeight - 1) {
for (yOffset = y; yOffset <= y + 1 + treeHeight; ++yOffset) {
byte radius = 1;
if (yOffset == y) {
@ -130,7 +130,7 @@ public class RubberTreeGenerator extends WorldGenerator {
|| block.canBeReplacedByLeaves(state1, world,
new BlockPos(xOffset, yOffset, zOffset)))) {
this.setBlockAndNotifyAdequately(world, new BlockPos(xOffset, yOffset, zOffset),
TRBlocks.RUBBER_LEAVES.getDefaultState().withProperty(BlockRubberLeaves.DECAYABLE, true).withProperty(BlockRubberLeaves.CHECK_DECAY, false));
TRContent.RUBBER_LEAVES.getDefaultState().withProperty(BlockRubberLeaves.DECAYABLE, true).withProperty(BlockRubberLeaves.CHECK_DECAY, false));
hasPlacedBlock = true;
}
}
@ -144,7 +144,7 @@ public class RubberTreeGenerator extends WorldGenerator {
Block block = state1.getBlock();
if (block == null || block.isAir(state1, world, blockpos) || block.isLeaves(state1, world, blockpos)
|| block.isReplaceable(world, blockpos)) {
IBlockState newState = TRBlocks.RUBBER_LOG.getDefaultState();
IBlockState newState = TRContent.RUBBER_LOG.getDefaultState();
boolean isAddingSap = false;
if (rand.nextInt(TechReborn.worldGen.config.rubberTreeConfig.sapRarity) == 0) {
newState = newState.withProperty(BlockRubberLog.HAS_SAP, true)
@ -163,7 +163,7 @@ public class RubberTreeGenerator extends WorldGenerator {
if (topLogPos != null) {
for (int i = 0; i < TechReborn.worldGen.config.rubberTreeConfig.spireHeight; i++) {
BlockPos spikePos = topLogPos.up(i);
this.setBlockAndNotifyAdequately(world, spikePos, TRBlocks.RUBBER_LEAVES.getDefaultState()
this.setBlockAndNotifyAdequately(world, spikePos, TRContent.RUBBER_LEAVES.getDefaultState()
.withProperty(BlockRubberLeaves.DECAYABLE, true).withProperty(BlockRubberLeaves.CHECK_DECAY, false));
}
}

View file

@ -33,7 +33,7 @@ import net.minecraft.world.World;
import net.minecraft.world.gen.structure.StructureBoundingBox;
import net.minecraft.world.gen.structure.StructureComponent;
import net.minecraft.world.gen.structure.StructureVillagePieces;
import techreborn.init.TRBlocks;
import techreborn.init.TRContent;
import techreborn.world.RubberTreeGenerator;
import java.util.List;
@ -71,7 +71,7 @@ public class VillageComponentRubberPlantaion extends StructureVillagePieces.Fiel
@Override
protected void setBlockState(World worldIn, IBlockState blockstateIn, int x, int y, int z, StructureBoundingBox boundingboxIn) {
if (isCrop(blockstateIn)) {
blockstateIn = TRBlocks.RUBBER_SAPLING.getDefaultState();
blockstateIn = TRContent.RUBBER_SAPLING.getDefaultState();
}
super.setBlockState(worldIn, blockstateIn, x, y, z, boundingboxIn);
}
@ -99,7 +99,7 @@ public class VillageComponentRubberPlantaion extends StructureVillagePieces.Fiel
BlockPos pos = new BlockPos(this.getXWithOffset(row, coloum), this.getYWithOffset(1), this.getZWithOffset(row, coloum));
if (!new RubberTreeGenerator(true).growTree(world, random, pos.getX(), pos.getY(), pos.getZ())) {
//Puts the sapling back if the tree did not grow
setBlockState(world, TRBlocks.RUBBER_SAPLING.getDefaultState(), row, 1, coloum, structureBoundingBox);
setBlockState(world, TRContent.RUBBER_SAPLING.getDefaultState(), row, 1, coloum, structureBoundingBox);
}
}
}