mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 03:15:07 +00:00
Some shotgun renames I should've done a long time ago
This commit is contained in:
1 parent
3227e1b591
commit
1b28cbe57f
47 files changed
+164
-164
No files matched your search
+1
-1
@@ -33,7 +33,7 @@ public class ColorSwitchingComponent extends MultiblockComponent {
|
||||
|
||||
@Override
|
||||
public IBlockState getBlockState() {
|
||||
return state.withProperty(colorProp, EnumDyeColor.byMetadata((int) (BotaniaAPI.internalHandler.getWorldElapsedTicks() / 20) % 16));
|
||||
return state.with(colorProp, EnumDyeColor.byMetadata((int) (BotaniaAPI.internalHandler.getWorldElapsedTicks() / 20) % 16));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -59,7 +59,7 @@ public final class ColorHandler {
|
||||
float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks;
|
||||
return Color.HSBtoRGB(time * 0.005F, 0.6F, 1F);
|
||||
} else {
|
||||
return state.getValue(BotaniaStateProps.COLOR).getColorValue();
|
||||
return state.get(BotaniaStateProps.COLOR).getColorValue();
|
||||
}
|
||||
},
|
||||
ModBlocks.manaPool, ModBlocks.creativePool, ModBlocks.dilutedPool, ModBlocks.fabulousPool
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.client.model.animation.Animation;
|
||||
import net.minecraftforge.common.animation.Event;
|
||||
@@ -163,11 +163,11 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer<Til
|
||||
}
|
||||
if(blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
BlockPos pos = te.getPos();
|
||||
IBlockAccess world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), pos);
|
||||
IBlockReader world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), pos);
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
if(state.getPropertyKeys().contains(Properties.StaticProperty))
|
||||
{
|
||||
state = state.withProperty(Properties.StaticProperty, false);
|
||||
state = state.with(Properties.StaticProperty, false);
|
||||
}
|
||||
if(state instanceof IExtendedBlockState)
|
||||
{
|
||||
@@ -179,7 +179,7 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer<Til
|
||||
// handleEvents(te, time, pair.getRight());
|
||||
|
||||
IBakedModel model = blockRenderer.getBlockModelShapes().getModelForState(exState.getClean());
|
||||
exState = exState.withProperty(Properties.AnimationProperty, pair.getLeft());
|
||||
exState = exState.with(Properties.AnimationProperty, pair.getLeft());
|
||||
|
||||
worldRenderer.setTranslation(x - pos.getX(), y - pos.getY(), z - pos.getZ());
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import vazkii.botania.api.lexicon.multiblock.IMultiblockRenderHook;
|
||||
import vazkii.botania.api.lexicon.multiblock.Multiblock;
|
||||
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
|
||||
@@ -160,7 +160,7 @@ public class RenderTilePylon extends TileEntitySpecialRenderer<TilePylon> implem
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, IBlockState state, MultiblockComponent comp) {
|
||||
public void renderBlockForMultiblock(IBlockReader world, Multiblock mb, IBlockState state, MultiblockComponent comp) {
|
||||
forceVariant = ((BlockPylon) state.getBlock()).variant;
|
||||
GlStateManager.translate(-0.5, -0.25, -0.5);
|
||||
renderPylon((TilePylon) comp.getTileEntity(), 0, 0, 0, 0, true);
|
||||
|
||||
@@ -100,7 +100,7 @@ public class RenderTileSpreader extends TileEntitySpecialRenderer<TileSpreader>
|
||||
if(spreader.paddingColor != -1) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
|
||||
IBlockState carpet = Blocks.CARPET.getDefaultState().withProperty(BlockCarpet.COLOR, EnumDyeColor.byMetadata(spreader.paddingColor));
|
||||
IBlockState carpet = Blocks.CARPET.getDefaultState().with(BlockCarpet.COLOR, EnumDyeColor.byMetadata(spreader.paddingColor));
|
||||
|
||||
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
|
||||
float f = 1 / 16F;
|
||||
|
||||
@@ -40,11 +40,11 @@ public class BlockCraftyCrate extends BlockOpenCrate implements IWandHUD {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
public IBlockState getActualState(@Nonnull IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
TileEntity te = world instanceof ChunkCache ? ((ChunkCache)world).getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK) : world.getTileEntity(pos);
|
||||
if(te instanceof TileCraftCrate) {
|
||||
TileCraftCrate tile = (TileCraftCrate) te;
|
||||
state = state.withProperty(BotaniaStateProps.CRATE_PATTERN, tile.pattern);
|
||||
state = state.with(BotaniaStateProps.CRATE_PATTERN, tile.pattern);
|
||||
}
|
||||
|
||||
return state;
|
||||
|
||||
@@ -28,7 +28,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.ChunkCache;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
@@ -68,17 +68,17 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
state = super.getExtendedState(state, world, pos);
|
||||
TileEntity te = world instanceof ChunkCache ? ((ChunkCache)world).getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK) : world.getTileEntity(pos);
|
||||
if (te instanceof TileFloatingSpecialFlower) {
|
||||
state = ((IExtendedBlockState) state).withProperty(BotaniaStateProps.SUBTILE_ID, ((TileFloatingSpecialFlower) te).subTileName);
|
||||
state = ((IExtendedBlockState) state).with(BotaniaStateProps.SUBTILE_ID, ((TileFloatingSpecialFlower) te).subTileName);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(@Nonnull IBlockState state, IBlockAccess world, @Nonnull BlockPos pos) {
|
||||
public int getLightValue(@Nonnull IBlockState state, IBlockReader world, @Nonnull BlockPos pos) {
|
||||
if(world.getBlockState(pos).getBlock() != this)
|
||||
return world.getBlockState(pos).getLightValue(world, pos);
|
||||
|
||||
@@ -97,12 +97,12 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
public int getWeakPower(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing side) {
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).getPowerLevel(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStrongPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
public int getStrongPower(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing side) {
|
||||
return getWeakPower(state, world, pos, side);
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops(NonNullList<ItemStack> list, IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) {
|
||||
public void getDrops(NonNullList<ItemStack> list, IBlockReader world, BlockPos pos, @Nonnull IBlockState state, int fortune) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if(tile != null) {
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -99,7 +99,7 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player) {
|
||||
public boolean canHarvestBlock(IBlockReader world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -110,11 +110,11 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, BlockPos pos, IBlockState state, @Nonnull EntityPlayer player) {
|
||||
if(state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
if(state.get(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
if(world.getBlockState(pos.down()).getBlock() == this) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
// IBlockState iblockstate = worldIn.getBlockState(pos.down());
|
||||
// BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType) iblockstate.getValue(VARIANT);
|
||||
// BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType) iblockstate.get(VARIANT);
|
||||
|
||||
//if (blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS) {
|
||||
// worldIn.destroyBlock(pos.down(), true);
|
||||
@@ -139,22 +139,22 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShearable(ItemStack item, IBlockAccess world, @Nonnull BlockPos pos) {
|
||||
public boolean isShearable(ItemStack item, IBlockReader world, @Nonnull BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, @Nonnull BlockPos pos, int fortune) {
|
||||
public List<ItemStack> onSheared(ItemStack item, IBlockReader world, @Nonnull BlockPos pos, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<>();
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
IBlockState stateBelow = world.getBlockState(pos.down());
|
||||
|
||||
if (stateBelow.getBlock() == this && stateBelow.getValue(HALF) == EnumBlockHalf.LOWER && state.getValue(HALF) == EnumBlockHalf.UPPER) {
|
||||
if (stateBelow.getBlock() == this && stateBelow.getValue(HALF) == EnumBlockHalf.LOWER && state.get(HALF) == EnumBlockHalf.UPPER) {
|
||||
ret.add(new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos.down()))));
|
||||
}
|
||||
|
||||
if (state.getValue(HALF) == EnumBlockHalf.LOWER) {
|
||||
if (state.get(HALF) == EnumBlockHalf.LOWER) {
|
||||
ret.add(new ItemStack(this, 1, getMetaFromState(state)));
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
state = getActualState(state, world, pos);
|
||||
int hex = state.getValue(second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getColorValue();
|
||||
int hex = state.get(second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getColorValue();
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
@@ -188,17 +188,17 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, @Nonnull IBlockAccess worldIn, @Nonnull BlockPos pos) {
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
public IBlockState getActualState(IBlockState state, @Nonnull IBlockReader worldIn, @Nonnull BlockPos pos) {
|
||||
if (state.get(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
IBlockState iblockstate = worldIn.getBlockState(pos.down());
|
||||
|
||||
if (iblockstate.getBlock() == this) {
|
||||
PropertyEnum<EnumDyeColor> prop = second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1;
|
||||
state = state.withProperty(prop, iblockstate.getValue(prop));
|
||||
state = state.with(prop, iblockstate.get(prop));
|
||||
}
|
||||
}
|
||||
|
||||
return state.withProperty(VARIANT, EnumPlantType.SUNFLOWER).withProperty(FACING, EnumFacing.SOUTH);
|
||||
return state.with(VARIANT, EnumPlantType.SUNFLOWER).with(FACING, EnumFacing.SOUTH);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -206,7 +206,7 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) {
|
||||
state = state.getBlock().getActualState(state, world, pos);
|
||||
PropertyEnum<EnumDyeColor> prop = second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1;
|
||||
return new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getValue(prop).ordinal() - (second ? 8 : 0));
|
||||
return new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.get(prop).ordinal() - (second ? 8 : 0));
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
||||
@@ -27,16 +27,16 @@ public class BlockModDoubleFlower1 extends BlockModDoubleFlower {
|
||||
@Override
|
||||
protected IBlockState pickDefaultState() {
|
||||
return blockState.getBaseState()
|
||||
.withProperty(FACING, EnumFacing.SOUTH)
|
||||
.withProperty(VARIANT, EnumPlantType.SUNFLOWER)
|
||||
.withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
.withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, EnumDyeColor.WHITE);
|
||||
.with(FACING, EnumFacing.SOUTH)
|
||||
.with(VARIANT, EnumPlantType.SUNFLOWER)
|
||||
.with(HALF, BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
.with(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, EnumDyeColor.WHITE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
int meta = state.getValue(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getMetadata();
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
int meta = state.get(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getMetadata();
|
||||
if (state.get(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
meta |= 8;
|
||||
}
|
||||
return meta;
|
||||
@@ -47,7 +47,7 @@ public class BlockModDoubleFlower1 extends BlockModDoubleFlower {
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
BlockDoublePlant.EnumBlockHalf half = (meta & 8) > 0 ? BlockDoublePlant.EnumBlockHalf.UPPER : BlockDoublePlant.EnumBlockHalf.LOWER;
|
||||
meta &= -9;
|
||||
return getDefaultState().withProperty(HALF, half).withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, EnumDyeColor.byMetadata(meta));
|
||||
return getDefaultState().with(HALF, half).with(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
||||
@@ -28,16 +28,16 @@ public class BlockModDoubleFlower2 extends BlockModDoubleFlower {
|
||||
@Override
|
||||
protected IBlockState pickDefaultState() {
|
||||
return blockState.getBaseState()
|
||||
.withProperty(FACING, EnumFacing.SOUTH)
|
||||
.withProperty(VARIANT, EnumPlantType.SUNFLOWER)
|
||||
.withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
.withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2, EnumDyeColor.SILVER);
|
||||
.with(FACING, EnumFacing.SOUTH)
|
||||
.with(VARIANT, EnumPlantType.SUNFLOWER)
|
||||
.with(HALF, BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
.with(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2, EnumDyeColor.SILVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
int meta = state.getValue(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2).getMetadata() - 8;
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
int meta = state.get(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2).getMetadata() - 8;
|
||||
if (state.get(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
meta |= 8;
|
||||
}
|
||||
return meta;
|
||||
@@ -48,7 +48,7 @@ public class BlockModDoubleFlower2 extends BlockModDoubleFlower {
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
BlockDoublePlant.EnumBlockHalf half = (meta & 8) > 0 ? BlockDoublePlant.EnumBlockHalf.UPPER : BlockDoublePlant.EnumBlockHalf.LOWER;
|
||||
meta &= -9;
|
||||
return getDefaultState().withProperty(HALF, half).withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2, EnumDyeColor.byMetadata(meta + 8));
|
||||
return getDefaultState().with(HALF, half).with(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2, EnumDyeColor.byMetadata(meta + 8));
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
||||
@@ -89,7 +89,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IGrowab
|
||||
|
||||
public static void placeDoubleFlower(World world, BlockPos pos, EnumDyeColor color, int flags) {
|
||||
Block flower = color.getMetadata() >= 8 ? ModBlocks.doubleFlower2 : ModBlocks.doubleFlower1;
|
||||
world.setBlockState(pos, flower.getDefaultState().withProperty(color.getMetadata() >= 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color).withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.LOWER), flags);
|
||||
world.setBlockState(pos.up(), flower.getDefaultState().withProperty(color.getMetadata() >= 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color).withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.UPPER), flags);
|
||||
world.setBlockState(pos, flower.getDefaultState().with(color.getMetadata() >= 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color).with(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.LOWER), flags);
|
||||
world.setBlockState(pos.up(), flower.getDefaultState().with(color.getMetadata() >= 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color).with(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.UPPER), flags);
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.ChunkCache;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
@@ -80,14 +80,14 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable,
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
state = ((IExtendedBlockState) state).withProperty(BotaniaStateProps.HELD_WORLD, world)
|
||||
.withProperty(BotaniaStateProps.HELD_POS, pos);
|
||||
public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
state = ((IExtendedBlockState) state).with(BotaniaStateProps.HELD_WORLD, world)
|
||||
.with(BotaniaStateProps.HELD_POS, pos);
|
||||
|
||||
TileEntity te = world instanceof ChunkCache ? ((ChunkCache)world).getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK) : world.getTileEntity(pos);
|
||||
if (te instanceof TileCamo) {
|
||||
TileCamo tile = (TileCamo) te;
|
||||
return ((IExtendedBlockState) state).withProperty(BotaniaStateProps.HELD_STATE, tile.camoState);
|
||||
return ((IExtendedBlockState) state).with(BotaniaStateProps.HELD_STATE, tile.camoState);
|
||||
} else {
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.ChunkCache;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
@@ -120,7 +120,7 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.3, 0, 0.3, 0.8, 1, 0.8);
|
||||
|
||||
protected BlockSpecialFlower() {
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE).withProperty(type, EnumFlowerType.POPPY));
|
||||
setDefaultState(blockState.getBaseState().with(BotaniaStateProps.COLOR, EnumDyeColor.WHITE).with(type, EnumFlowerType.POPPY));
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, LibBlockNames.SPECIAL_FLOWER));
|
||||
setTranslationKey(LibBlockNames.SPECIAL_FLOWER);
|
||||
setHardness(0.1F);
|
||||
@@ -131,7 +131,7 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos) {
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, @Nonnull IBlockReader world, @Nonnull BlockPos pos) {
|
||||
return AABB.offset(state.getOffset(world, pos));
|
||||
}
|
||||
|
||||
@@ -143,12 +143,12 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IExtendedBlockState getExtendedState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
public IExtendedBlockState getExtendedState(@Nonnull IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
TileEntity te = world instanceof ChunkCache ? ((ChunkCache)world).getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK) : world.getTileEntity(pos);
|
||||
if (te instanceof TileSpecialFlower && ((TileSpecialFlower) te).getSubTile() != null) {
|
||||
Class<? extends SubTileEntity> clazz = ((TileSpecialFlower) te).getSubTile().getClass();
|
||||
ResourceLocation id = BotaniaAPI.getSubTileStringMapping(clazz);
|
||||
return ((IExtendedBlockState) state).withProperty(BotaniaStateProps.SUBTILE_ID, id);
|
||||
return ((IExtendedBlockState) state).with(BotaniaStateProps.SUBTILE_ID, id);
|
||||
} else {
|
||||
return (IExtendedBlockState) state;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(BotaniaStateProps.COLOR).getMetadata();
|
||||
return state.get(BotaniaStateProps.COLOR).getMetadata();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -165,11 +165,11 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
if (meta > 15) {
|
||||
meta = 0;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta));
|
||||
return getDefaultState().with(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(@Nonnull IBlockState state, IBlockAccess world, @Nonnull BlockPos pos) {
|
||||
public int getLightValue(@Nonnull IBlockState state, IBlockReader world, @Nonnull BlockPos pos) {
|
||||
if(world.getBlockState(pos).getBlock() != this)
|
||||
return world.getBlockState(pos).getLightValue(world, pos);
|
||||
|
||||
@@ -187,12 +187,12 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
public int getWeakPower(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing side) {
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).getPowerLevel(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStrongPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
public int getStrongPower(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing side) {
|
||||
return getWeakPower(state, world, pos, side);
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops(NonNullList<ItemStack> list, IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) {
|
||||
public void getDrops(NonNullList<ItemStack> list, IBlockReader world, BlockPos pos, @Nonnull IBlockState state, int fortune) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if(tile != null) {
|
||||
@@ -315,9 +315,9 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if(!stack.isEmpty() && stack.getItem() instanceof ItemDye) {
|
||||
EnumDyeColor newColor = ((ItemDye) stack.getItem()).color;
|
||||
EnumDyeColor oldColor = state.getValue(BotaniaStateProps.COLOR);
|
||||
EnumDyeColor oldColor = state.get(BotaniaStateProps.COLOR);
|
||||
if(newColor != oldColor)
|
||||
world.setBlockState(pos, state.withProperty(BotaniaStateProps.COLOR, newColor), 1 | 2);
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.COLOR, newColor), 1 | 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
|
||||
@@ -190,8 +190,8 @@ public final class ModFluffBlocks {
|
||||
|
||||
int count = 0;
|
||||
for (BiomeStoneVariant variant : BiomeStoneVariant.values()) {
|
||||
biomeStoneStairs[count] = new BlockBiomeStoneStairs(biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant));
|
||||
biomeStoneSlabs[count] = new BlockBiomeStoneSlab(false, biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant), count);
|
||||
biomeStoneStairs[count] = new BlockBiomeStoneStairs(biomeStoneA.getDefaultState().with(BotaniaStateProps.BIOMESTONE_VARIANT, variant));
|
||||
biomeStoneSlabs[count] = new BlockBiomeStoneSlab(false, biomeStoneA.getDefaultState().with(BotaniaStateProps.BIOMESTONE_VARIANT, variant), count);
|
||||
r.register(biomeStoneStairs[count]);
|
||||
r.register(biomeStoneSlabs[count]);
|
||||
count++;
|
||||
@@ -202,8 +202,8 @@ public final class ModFluffBlocks {
|
||||
// No chiseled stairs/slabs
|
||||
continue;
|
||||
}
|
||||
biomeStoneStairs[count] = new BlockBiomeStoneStairs(biomeStoneB.getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, variant));
|
||||
biomeStoneSlabs[count] = new BlockBiomeStoneSlab(false, biomeStoneB.getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, variant), count);
|
||||
biomeStoneStairs[count] = new BlockBiomeStoneStairs(biomeStoneB.getDefaultState().with(BotaniaStateProps.BIOMEBRICK_VARIANT, variant));
|
||||
biomeStoneSlabs[count] = new BlockBiomeStoneSlab(false, biomeStoneB.getDefaultState().with(BotaniaStateProps.BIOMEBRICK_VARIANT, variant), count);
|
||||
r.register(biomeStoneStairs[count]);
|
||||
r.register(biomeStoneSlabs[count]);
|
||||
count++;
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
@@ -49,7 +49,7 @@ public class BlockCorporeaCrystalCube extends BlockCorporeaBase implements ILexi
|
||||
|
||||
public BlockCorporeaCrystalCube(Block.Builder builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().withProperty(Properties.StaticProperty, true));
|
||||
setDefaultState(stateContainer.getBaseState().with(Properties.StaticProperty, true));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -60,8 +60,8 @@ public class BlockCorporeaCrystalCube extends BlockCorporeaBase implements ILexi
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return state.withProperty(Properties.StaticProperty, true);
|
||||
public IBlockState getActualState(@Nonnull IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
return state.with(Properties.StaticProperty, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,7 +74,7 @@ public class BlockCorporeaCrystalCube extends BlockCorporeaBase implements ILexi
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.ChunkCache;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
@@ -76,12 +76,12 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
setHardness(0.5F);
|
||||
setSoundType(SoundType.GROUND);
|
||||
setLightLevel(1F);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
setDefaultState(blockState.getBaseState().with(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(BotaniaStateProps.COLOR).getMetadata();
|
||||
return state.get(BotaniaStateProps.COLOR).getMetadata();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -115,18 +115,18 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
if (meta >= EnumDyeColor.values().length) {
|
||||
meta = 0;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta));
|
||||
return getDefaultState().with(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
state = getActualState(state, world, pos);
|
||||
TileEntity te = world instanceof ChunkCache ? ((ChunkCache)world).getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK) : world.getTileEntity(pos);
|
||||
if (te instanceof TileFloatingFlower) {
|
||||
state = ((IExtendedBlockState) state).withProperty(BotaniaStateProps.ISLAND_TYPE, ((TileFloatingFlower) te).getIslandType());
|
||||
state = ((IExtendedBlockState) state).with(BotaniaStateProps.ISLAND_TYPE, ((TileFloatingFlower) te).getIslandType());
|
||||
} else if (te instanceof TileFloatingSpecialFlower) {
|
||||
state = ((IExtendedBlockState) state).withProperty(BotaniaStateProps.ISLAND_TYPE, ((TileFloatingSpecialFlower) te).getIslandType());
|
||||
state = ((IExtendedBlockState) state).with(BotaniaStateProps.ISLAND_TYPE, ((TileFloatingSpecialFlower) te).getIslandType());
|
||||
}
|
||||
return state;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
int hex = state.getValue(BotaniaStateProps.COLOR).getColorValue();
|
||||
int hex = state.get(BotaniaStateProps.COLOR).getColorValue();
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
@@ -223,7 +223,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing side) {
|
||||
public BlockFaceShape getBlockFaceShape(IBlockReader world, IBlockState state, BlockPos pos, EnumFacing side) {
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class BlockPavement extends BlockMod {
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setSoundType(SoundType.STONE);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.PAVEMENT_COLOR, EnumDyeColor.WHITE));
|
||||
setDefaultState(blockState.getBaseState().with(BotaniaStateProps.PAVEMENT_COLOR, EnumDyeColor.WHITE));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -51,7 +51,7 @@ public class BlockPavement extends BlockMod {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
switch (state.getValue(BotaniaStateProps.PAVEMENT_COLOR)) {
|
||||
switch (state.get(BotaniaStateProps.PAVEMENT_COLOR)) {
|
||||
case GREEN: return 5;
|
||||
case YELLOW: return 4;
|
||||
case RED: return 3;
|
||||
@@ -79,7 +79,7 @@ public class BlockPavement extends BlockMod {
|
||||
case 0:
|
||||
default: color = EnumDyeColor.WHITE; break;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.PAVEMENT_COLOR, color);
|
||||
return getDefaultState().with(BotaniaStateProps.PAVEMENT_COLOR, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
@@ -29,7 +29,7 @@ public class BlockBiomeStoneA extends BlockBiomeStone {
|
||||
|
||||
public BlockBiomeStoneA() {
|
||||
super(LibBlockNames.BIOME_STONE_A);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, BiomeStoneVariant.FOREST));
|
||||
setDefaultState(blockState.getBaseState().with(BotaniaStateProps.BIOMESTONE_VARIANT, BiomeStoneVariant.FOREST));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -40,7 +40,7 @@ public class BlockBiomeStoneA extends BlockBiomeStone {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(BotaniaStateProps.BIOMESTONE_VARIANT).ordinal();
|
||||
return state.get(BotaniaStateProps.BIOMESTONE_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -49,11 +49,11 @@ public class BlockBiomeStoneA extends BlockBiomeStone {
|
||||
if (meta >= BiomeStoneVariant.values().length) {
|
||||
meta = 0;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, BiomeStoneVariant.values()[meta]);
|
||||
return getDefaultState().with(BotaniaStateProps.BIOMESTONE_VARIANT, BiomeStoneVariant.values()[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
public void getDrops(NonNullList<ItemStack> drops, IBlockReader world, BlockPos pos, IBlockState state, int fortune) {
|
||||
int cobbleMeta = getMetaFromState(state) | 0x8;
|
||||
drops.add(new ItemStack(this, 1, cobbleMeta));
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class BlockBiomeStoneB extends BlockBiomeStone {
|
||||
|
||||
public BlockBiomeStoneB() {
|
||||
super(LibBlockNames.BIOME_STONE_B);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, BiomeBrickVariant.FOREST));
|
||||
setDefaultState(blockState.getBaseState().with(BotaniaStateProps.BIOMEBRICK_VARIANT, BiomeBrickVariant.FOREST));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -36,7 +36,7 @@ public class BlockBiomeStoneB extends BlockBiomeStone {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(BotaniaStateProps.BIOMEBRICK_VARIANT).ordinal();
|
||||
return state.get(BotaniaStateProps.BIOMEBRICK_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -45,7 +45,7 @@ public class BlockBiomeStoneB extends BlockBiomeStone {
|
||||
if (meta >= BiomeBrickVariant.values().length) {
|
||||
meta = 0;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, BiomeBrickVariant.values()[meta]);
|
||||
return getDefaultState().with(BotaniaStateProps.BIOMEBRICK_VARIANT, BiomeBrickVariant.values()[meta]);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import vazkii.botania.client.render.IModelRegister;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
@@ -41,12 +41,12 @@ public class BlockModPane extends BlockPane implements IModelRegister {
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess iblockaccess, BlockPos pos, EnumFacing side) {
|
||||
public boolean shouldSideBeRendered(IBlockState state, IBlockReader iblockaccess, BlockPos pos, EnumFacing side) {
|
||||
return false;
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, @Nonnull EnumFacing dir) {
|
||||
public boolean canPaneConnectTo(IBlockReader world, BlockPos pos, @Nonnull EnumFacing dir) {
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
return block == ModBlocks.elfGlass || block == ModBlocks.manaGlass || block == ModBlocks.bifrostPerm || super.canPaneConnectTo(world, pos, dir);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable {
|
||||
this.type = type;
|
||||
setHardness(0.8F);
|
||||
setResistance(10F);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.NORMAL));
|
||||
setDefaultState(blockState.getBaseState().with(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.NORMAL));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -54,7 +54,7 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(BotaniaStateProps.QUARTZ_VARIANT).ordinal();
|
||||
return state.get(BotaniaStateProps.QUARTZ_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -63,7 +63,7 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable {
|
||||
if (meta >= QuartzVariant.values().length) {
|
||||
meta = 0;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.values()[meta]);
|
||||
return getDefaultState().with(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.values()[meta]);
|
||||
}
|
||||
|
||||
public String[] getNames() {
|
||||
@@ -80,11 +80,11 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable {
|
||||
if (meta == 2) { // Pillar quartz variant
|
||||
switch (side.getAxis()) {
|
||||
case Y:
|
||||
return getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Y);
|
||||
return getDefaultState().with(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Y);
|
||||
case Z:
|
||||
return getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Z);
|
||||
return getDefaultState().with(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Z);
|
||||
case X:
|
||||
return getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_X);
|
||||
return getDefaultState().with(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_X);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,9 +93,9 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
QuartzVariant variant = state.getValue(BotaniaStateProps.QUARTZ_VARIANT);
|
||||
QuartzVariant variant = state.get(BotaniaStateProps.QUARTZ_VARIANT);
|
||||
if (variant == QuartzVariant.PILLAR_X || variant == QuartzVariant.PILLAR_Z) {
|
||||
state = state.withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Y);
|
||||
state = state.with(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Y);
|
||||
}
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
@@ -122,8 +122,8 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable {
|
||||
@Override
|
||||
public void registerModels() {
|
||||
ModelHandler.registerBlockToState(this, 0, getDefaultState());
|
||||
ModelHandler.registerBlockToState(this, 1, getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.CHISELED));
|
||||
ModelHandler.registerBlockToState(this, 2, getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Y));
|
||||
ModelHandler.registerBlockToState(this, 1, getDefaultState().with(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.CHISELED));
|
||||
ModelHandler.registerBlockToState(this, 2, getDefaultState().with(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Y));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public abstract class BlockModSlab extends BlockSlab implements ILexiconable, IM
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
setDefaultState(blockState.getBaseState().withProperty(HALF, EnumBlockHalf.BOTTOM).withProperty(DUMMY, DummyEnum.SINGLETON));
|
||||
setDefaultState(blockState.getBaseState().with(HALF, EnumBlockHalf.BOTTOM).with(DUMMY, DummyEnum.SINGLETON));
|
||||
if(!isDouble())
|
||||
ModFluffBlocks.slabsToRegister.add(this);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public abstract class BlockModSlab extends BlockSlab implements ILexiconable, IM
|
||||
if (doubleSlab) {
|
||||
return getDefaultState();
|
||||
} else {
|
||||
return getDefaultState().withProperty(HALF, meta == 8 ? EnumBlockHalf.TOP : EnumBlockHalf.BOTTOM);
|
||||
return getDefaultState().with(HALF, meta == 8 ? EnumBlockHalf.TOP : EnumBlockHalf.BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public abstract class BlockModSlab extends BlockSlab implements ILexiconable, IM
|
||||
if (doubleSlab) {
|
||||
return 0;
|
||||
} else {
|
||||
return state.getValue(HALF) == EnumBlockHalf.TOP ? 8 : 0;
|
||||
return state.get(HALF) == EnumBlockHalf.TOP ? 8 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class BlockPavementSlab extends BlockLivingSlab {
|
||||
final int index;
|
||||
|
||||
public BlockPavementSlab(boolean full, EnumDyeColor color, int index) {
|
||||
super(full, ModFluffBlocks.pavement.getDefaultState().withProperty(BotaniaStateProps.PAVEMENT_COLOR, color));
|
||||
super(full, ModFluffBlocks.pavement.getDefaultState().with(BotaniaStateProps.PAVEMENT_COLOR, color));
|
||||
this.index = index;
|
||||
setHardness(2F);
|
||||
setResistance(10F);
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
public class BlockDreamwoodPlankSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockDreamwoodPlankSlab(boolean full) {
|
||||
super(full, ModBlocks.dreamwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS));
|
||||
super(full, ModBlocks.dreamwood.getDefaultState().with(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS));
|
||||
setHardness(2.0F);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
public class BlockLivingrockBrickSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockLivingrockBrickSlab(boolean full) {
|
||||
super(full, ModBlocks.livingrock.getDefaultState().withProperty(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.BRICK));
|
||||
super(full, ModBlocks.livingrock.getDefaultState().with(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.BRICK));
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setSoundType(SoundType.STONE);
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
public class BlockLivingwoodPlankSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockLivingwoodPlankSlab(boolean full) {
|
||||
super(full, ModBlocks.livingwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS));
|
||||
super(full, ModBlocks.livingwood.getDefaultState().with(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS));
|
||||
setHardness(2.0F);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockPavementStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockPavementStairs(EnumDyeColor color) {
|
||||
super(ModFluffBlocks.pavement.getDefaultState().withProperty(BotaniaStateProps.PAVEMENT_COLOR, color));
|
||||
super(ModFluffBlocks.pavement.getDefaultState().with(BotaniaStateProps.PAVEMENT_COLOR, color));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
public class BlockDreamwoodPlankStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockDreamwoodPlankStairs() {
|
||||
super(ModBlocks.dreamwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS));
|
||||
super(ModBlocks.dreamwood.getDefaultState().with(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS));
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -8,7 +8,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
public class BlockLivingrockBrickStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockLivingrockBrickStairs() {
|
||||
super(ModBlocks.livingrock.getDefaultState().withProperty(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.BRICK));
|
||||
super(ModBlocks.livingrock.getDefaultState().with(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.BRICK));
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -8,7 +8,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
public class BlockLivingwoodPlankStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockLivingwoodPlankStairs() {
|
||||
super(ModBlocks.livingwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS));
|
||||
super(ModBlocks.livingwood.getDefaultState().with(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -48,12 +48,12 @@ public class BlockBiomeStoneWall extends BlockModWall {
|
||||
|
||||
@Override
|
||||
protected IBlockState pickDefaultState() {
|
||||
return super.pickDefaultState().withProperty(BotaniaStateProps.BIOMESTONEWALL_VARIANT, BiomeStoneVariant.FOREST_COBBLE);
|
||||
return super.pickDefaultState().with(BotaniaStateProps.BIOMESTONEWALL_VARIANT, BiomeStoneVariant.FOREST_COBBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(BotaniaStateProps.BIOMESTONEWALL_VARIANT).ordinal() - 8;
|
||||
return state.get(BotaniaStateProps.BIOMESTONEWALL_VARIANT).ordinal() - 8;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -62,7 +62,7 @@ public class BlockBiomeStoneWall extends BlockModWall {
|
||||
if (meta < 0 || meta >= BotaniaStateProps.BIOMESTONEWALL_VARIANT.getAllowedValues().size()) {
|
||||
meta = 0;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.BIOMESTONEWALL_VARIANT, BiomeStoneVariant.values()[meta + 8]);
|
||||
return getDefaultState().with(BotaniaStateProps.BIOMESTONEWALL_VARIANT, BiomeStoneVariant.values()[meta + 8]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,7 +20,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -47,8 +47,8 @@ public abstract class BlockModWall extends BlockWall implements ILexiconable, IM
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return super.getActualState(state, world, pos).withProperty(VARIANT, EnumType.NORMAL);
|
||||
public IBlockState getActualState(IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
return super.getActualState(state, world, pos).with(VARIANT, EnumType.NORMAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,12 +64,12 @@ public abstract class BlockModWall extends BlockWall implements ILexiconable, IM
|
||||
|
||||
protected IBlockState pickDefaultState() {
|
||||
return blockState.getBaseState()
|
||||
.withProperty(UP, false)
|
||||
.withProperty(NORTH, false)
|
||||
.withProperty(SOUTH, false)
|
||||
.withProperty(WEST, false)
|
||||
.withProperty(EAST, false)
|
||||
.withProperty(VARIANT, EnumType.NORMAL);
|
||||
.with(UP, false)
|
||||
.with(NORTH, false)
|
||||
.with(SOUTH, false)
|
||||
.with(WEST, false)
|
||||
.with(EAST, false)
|
||||
.with(VARIANT, EnumType.NORMAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,7 +84,7 @@ public abstract class BlockModWall extends BlockWall implements ILexiconable, IM
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceTorchOnTop(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos) {
|
||||
public boolean canPlaceTorchOnTop(IBlockState state, @Nonnull IBlockReader world, @Nonnull BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.ChunkCache;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
@@ -82,7 +82,7 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockReader world, BlockPos pos, IBlockState state, int fortune) {
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
if (te instanceof TilePool && !((TilePool) te).fragile) {
|
||||
super.getDrops(drops, world, pos, state, fortune);
|
||||
|
||||
@@ -46,7 +46,7 @@ public class BlockPump extends BlockMod implements ILexiconable {
|
||||
|
||||
public BlockPump(Builder builder) {
|
||||
super(builder);
|
||||
setDefaultState(blockState.getBaseState().withProperty(Properties.StaticProperty, true).withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH));
|
||||
setDefaultState(blockState.getBaseState().with(Properties.StaticProperty, true).with(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -57,8 +57,8 @@ public class BlockPump extends BlockMod implements ILexiconable {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return state.withProperty(Properties.StaticProperty, true);
|
||||
public IBlockState getActualState(@Nonnull IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
return state.with(Properties.StaticProperty, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -77,7 +77,7 @@ public class BlockTerraPlate extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPassable(IBlockAccess world, BlockPos pos) {
|
||||
public boolean isPassable(IBlockReader world, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,9 +91,9 @@ public class TileAlfPortal extends TileMod implements ITickable {
|
||||
for(BlockPos l : LIVINGWOOD_POSITIONS)
|
||||
mb.addComponent(l.up(), ModBlocks.livingwood.getDefaultState());
|
||||
for(BlockPos g : GLIMMERING_LIVINGWOOD_POSITIONS)
|
||||
mb.addComponent(g.up(), ModBlocks.livingwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.GLIMMERING));
|
||||
mb.addComponent(g.up(), ModBlocks.livingwood.getDefaultState().with(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.GLIMMERING));
|
||||
// for(BlockPos p : PYLON_POSITIONS)
|
||||
// mb.addComponent(new BlockPos(-p.getX(), p.getY() + 1, -p.getZ()), ModBlocks.pylon.getDefaultState().withProperty(BotaniaStateProps.PYLON_VARIANT, PylonVariant.NATURA));
|
||||
// mb.addComponent(new BlockPos(-p.getX(), p.getY() + 1, -p.getZ()), ModBlocks.pylon.getDefaultState().with(BotaniaStateProps.PYLON_VARIANT, PylonVariant.NATURA));
|
||||
// for(BlockPos p : POOL_POSITIONS)
|
||||
// mb.addComponent(new StateInsensitiveComponent(new BlockPos(-p.getX(), p.getY() + 1, -p.getZ()), ModBlocks.pool));
|
||||
|
||||
@@ -166,7 +166,7 @@ public class TileAlfPortal extends TileMod implements ITickable {
|
||||
if(newState == AlfPortalState.OFF)
|
||||
for(int i = 0; i < 36; i++)
|
||||
blockParticle(state);
|
||||
world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2);
|
||||
world.setBlockState(getPos(), world.getBlockState(getPos()).with(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2);
|
||||
} else if(explode) {
|
||||
world.createExplosion(null, pos.getX() + .5, pos.getY() + 2.0, pos.getZ() + .5, 3f, true);
|
||||
explode = false;
|
||||
@@ -214,7 +214,7 @@ public class TileAlfPortal extends TileMod implements ITickable {
|
||||
if(state == AlfPortalState.OFF) {
|
||||
AlfPortalState newState = getValidState();
|
||||
if(newState != AlfPortalState.OFF) {
|
||||
world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2);
|
||||
world.setBlockState(getPos(), world.getBlockState(getPos()).with(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -331,11 +331,11 @@ public class TileAlfPortal extends TileMod implements ITickable {
|
||||
private final boolean checkMultipleConverters(Function<BlockPos, BlockPos>... converters) {
|
||||
if(!check2DArray(AIR_POSITIONS, Blocks.AIR.getDefaultState(), true, converters))
|
||||
return false;
|
||||
if(!check2DArray(LIVINGWOOD_POSITIONS, ModBlocks.livingwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.DEFAULT), false, converters))
|
||||
if(!check2DArray(LIVINGWOOD_POSITIONS, ModBlocks.livingwood.getDefaultState().with(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.DEFAULT), false, converters))
|
||||
return false;
|
||||
if(!check2DArray(GLIMMERING_LIVINGWOOD_POSITIONS, ModBlocks.livingwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.GLIMMERING), false, converters))
|
||||
if(!check2DArray(GLIMMERING_LIVINGWOOD_POSITIONS, ModBlocks.livingwood.getDefaultState().with(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.GLIMMERING), false, converters))
|
||||
return false;
|
||||
// if(!check2DArray(PYLON_POSITIONS, ModBlocks.pylon.getDefaultState().withProperty(BotaniaStateProps.PYLON_VARIANT, PylonVariant.NATURA), false, converters))
|
||||
// if(!check2DArray(PYLON_POSITIONS, ModBlocks.pylon.getDefaultState().with(BotaniaStateProps.PYLON_VARIANT, PylonVariant.NATURA), false, converters))
|
||||
// return false;
|
||||
// if(!check2DArray(POOL_POSITIONS, ModBlocks.pool.getDefaultState(), true, converters))
|
||||
// return false;
|
||||
|
||||
@@ -176,9 +176,9 @@ public class TileLightRelay extends TileMod implements ITickable, IWandBindable
|
||||
|
||||
public BlockPos getNextDestination() {
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
if(state.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.TOGGLE && state.getValue(BotaniaStateProps.POWERED))
|
||||
if(state.get(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.TOGGLE && state.get(BotaniaStateProps.POWERED))
|
||||
return null;
|
||||
else if(state.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.FORK) {
|
||||
else if(state.get(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.FORK) {
|
||||
BlockPos torchPos = null;
|
||||
for(int i = -2; i < 3; i++) {
|
||||
BlockPos testPos = pos.add(0, i, 0);
|
||||
@@ -281,7 +281,7 @@ public class TileLightRelay extends TileMod implements ITickable, IWandBindable
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile != null && tile instanceof TileLightRelay) {
|
||||
if(world.getBlockState(pos).getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DETECTOR) {
|
||||
world.setBlockState(pos, world.getBlockState(pos).withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
|
||||
world.setBlockState(pos, world.getBlockState(pos).with(BotaniaStateProps.POWERED, true), 1 | 2);
|
||||
world.scheduleUpdate(pos, tile.getBlockType(), tile.getBlockType().tickRate(world));
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class TileManaDetector extends TileMod implements ITickable {
|
||||
boolean state = world.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
|
||||
boolean expectedState = world.getEntitiesWithinAABB(EntityThrowable.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)), Predicates.instanceOf(IManaBurst.class)).size() != 0;
|
||||
if(state != expectedState && !world.isRemote)
|
||||
world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, expectedState), 1 | 2);
|
||||
world.setBlockState(getPos(), world.getBlockState(getPos()).with(BotaniaStateProps.POWERED, expectedState), 1 | 2);
|
||||
|
||||
if(expectedState)
|
||||
for(int i = 0; i < 4; i++)
|
||||
|
||||
@@ -56,7 +56,7 @@ public final class BiomeDecorationHandler {
|
||||
int z1 = z + event.getRand().nextInt(dist * 2) - dist;
|
||||
BlockPos pos2 = new BlockPos(x1, y1, z1);
|
||||
if(event.getWorld().isAirBlock(pos2) && (!event.getWorld().provider.isNether() || y1 < 127) && ModBlocks.flower.canPlaceBlockAt(event.getWorld(), pos2)) {
|
||||
event.getWorld().setBlockState(pos2, ModBlocks.flower.getDefaultState().withProperty(BotaniaStateProps.COLOR, color), 2);
|
||||
event.getWorld().setBlockState(pos2, ModBlocks.flower.getDefaultState().with(BotaniaStateProps.COLOR, color), 2);
|
||||
if(event.getRand().nextDouble() < ConfigHandler.flowerTallChance && ((BlockModFlower) ModBlocks.flower).canGrow(event.getWorld(), pos2, event.getWorld().getBlockState(pos2), false))
|
||||
BlockModFlower.placeDoubleFlower(event.getWorld(), pos2, color, 0);
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public final class BiomeDecorationHandler {
|
||||
BlockPos pos3 = new BlockPos(x, y, z);
|
||||
EnumDyeColor color = EnumDyeColor.byMetadata(event.getRand().nextInt(16));
|
||||
if(event.getWorld().isAirBlock(pos3) && ModBlocks.mushroom.canPlaceBlockAt(event.getWorld(), pos3))
|
||||
event.getWorld().setBlockState(pos3, ModBlocks.mushroom.getDefaultState().withProperty(BotaniaStateProps.COLOR, color), 2);
|
||||
event.getWorld().setBlockState(pos3, ModBlocks.mushroom.getDefaultState().with(BotaniaStateProps.COLOR, color), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ItemFertilizer extends ItemMod {
|
||||
for(int i = 0; i < flowerCount; i++) {
|
||||
BlockPos coords = validCoords.get(world.rand.nextInt(validCoords.size()));
|
||||
validCoords.remove(coords);
|
||||
world.setBlockState(coords, ModBlocks.flower.getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(world.rand.nextInt(16))), 1 | 2);
|
||||
world.setBlockState(coords, ModBlocks.flower.getDefaultState().with(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(world.rand.nextInt(16))), 1 | 2);
|
||||
}
|
||||
player.getHeldItem(hand).shrink(1);
|
||||
} else {
|
||||
|
||||
@@ -92,7 +92,7 @@ public class ItemGaiaHead extends ItemMod {
|
||||
if (worldIn.isRemote) {
|
||||
return EnumActionResult.SUCCESS;
|
||||
} else {
|
||||
worldIn.setBlockState(pos, ModBlocks.gaiaHead.getDefaultState().withProperty(BlockSkull.FACING, facing), 11); // Botania - skull -> gaia head
|
||||
worldIn.setBlockState(pos, ModBlocks.gaiaHead.getDefaultState().with(BlockSkull.FACING, facing), 11); // Botania - skull -> gaia head
|
||||
int i = 0;
|
||||
|
||||
if (facing == EnumFacing.UP) {
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant {
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
|
||||
if(state.getBlock() == Blocks.DIRT && state.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT || state.getBlock() == Blocks.GRASS && type != IslandType.GRASS) {
|
||||
if(state.getBlock() == Blocks.DIRT && state.get(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT || state.getBlock() == Blocks.GRASS && type != IslandType.GRASS) {
|
||||
if(!world.isRemote) {
|
||||
BlockSwapper swapper = addBlockSwapper(world, pos, type);
|
||||
world.setBlockState(pos, swapper.stateToSet);
|
||||
@@ -166,7 +166,7 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant {
|
||||
|
||||
private static IBlockState stateForType(IslandType type) {
|
||||
if(type == IslandType.PODZOL)
|
||||
return Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL);
|
||||
return Blocks.DIRT.getDefaultState().with(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL);
|
||||
else if(type == IslandType.MYCEL)
|
||||
return Blocks.MYCELIUM.getDefaultState();
|
||||
else if(type == IslandType.DRY)
|
||||
@@ -287,7 +287,7 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant {
|
||||
// levels by 2 or more blocks grass growth.
|
||||
|
||||
return (block == Blocks.DIRT || block == Blocks.GRASS)
|
||||
&& (block != Blocks.DIRT || state.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT)
|
||||
&& (block != Blocks.DIRT || state.get(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT)
|
||||
&& world.getBlockState(pos.up()).getLightOpacity(world, pos.up()) <= 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ItemOpenBucket extends ItemMod {
|
||||
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(state.getBlock());
|
||||
boolean isFull = state.getBlock() instanceof BlockLiquid && state.getValue(BlockLiquid.LEVEL) == 0
|
||||
boolean isFull = state.getBlock() instanceof BlockLiquid && state.get(BlockLiquid.LEVEL) == 0
|
||||
|| state.getBlock() instanceof IFluidBlock && Math.abs(((IFluidBlock) state.getBlock()).getFilledPercentage(world, pos)) >= 1;
|
||||
|
||||
if(fluid != null && isFull) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ItemDye extends Item16Colors {
|
||||
|
||||
if(block == Blocks.WOOL && color != world.getBlockState(pos).getValue(BlockColored.COLOR)
|
||||
|| block == Blocks.CARPET && color != world.getBlockState(pos).getValue(BlockCarpet.COLOR)) {
|
||||
world.setBlockState(pos, world.getBlockState(pos).withProperty(block == Blocks.WOOL ? BlockColored.COLOR : BlockCarpet.COLOR, color), 1 | 2);
|
||||
world.setBlockState(pos, world.getBlockState(pos).with(block == Blocks.WOOL ? BlockColored.COLOR : BlockCarpet.COLOR, color), 1 | 2);
|
||||
stack.shrink(1);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user