mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 19:05:16 +00:00
Move ShaderCallback into mod, remove BotaniaStateProps.POWERED in favor of vanilla equivalent
This commit is contained in:
1 parent
4a63807d09
commit
0c04fa30b1
33 files changed
+107
-116
No files matched your search
@@ -10,8 +10,8 @@ package vazkii.botania.api.item;
|
||||
|
||||
/**
|
||||
* Base Interface for the Manaseer Monocle and items of the sort.
|
||||
* Having a IBauble of this type equipped on the 0th slot (amulet)
|
||||
* will draw bursts without depth testing and to see sub tile radiuses.
|
||||
* Having an accessory of this type equipped
|
||||
* will draw bursts without depth testing and allow the player to see magical flower radiuses.
|
||||
*/
|
||||
public interface IBurstViewerBauble {
|
||||
|
||||
|
||||
@@ -28,10 +28,6 @@ public final class BotaniaStateProps {
|
||||
// The property for floating flower island type
|
||||
public static final ModelProperty<IFloatingFlower> FLOATING_DATA = new ModelProperty<>();
|
||||
|
||||
// Redstone power - boolean
|
||||
// Also for any other simple boolean "on/off" state
|
||||
public static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||
|
||||
// BlockAlfPortal
|
||||
public static final EnumProperty<AlfPortalState> ALFPORTAL_STATE = EnumProperty.create("state", AlfPortalState.class);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.internal.ShaderCallback;
|
||||
import vazkii.botania.client.core.helper.ShaderCallback;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
@@ -42,7 +42,6 @@ import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.internal.ShaderCallback;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.render.tile.RenderTilePylon;
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.api.internal;
|
||||
package vazkii.botania.client.core.helper;
|
||||
|
||||
/**
|
||||
* A Callback for when a shader is called. Used to define shader uniforms.
|
||||
@@ -22,7 +22,6 @@ import net.minecraftforge.fml.ModList;
|
||||
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import vazkii.botania.api.internal.ShaderCallback;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
|
||||
@@ -10,7 +10,6 @@ package vazkii.botania.client.core.helper;
|
||||
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
|
||||
import vazkii.botania.api.internal.ShaderCallback;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.client.renderer.entity.model.BipedModel;
|
||||
import net.minecraft.client.resources.DefaultPlayerSkin;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import vazkii.botania.api.internal.ShaderCallback;
|
||||
import vazkii.botania.client.core.helper.ShaderCallback;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.core.helper.ShaderWrappedRenderLayer;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.client.renderer.entity.EntityRendererManager;
|
||||
import net.minecraft.client.renderer.entity.MobRenderer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import vazkii.botania.api.internal.ShaderCallback;
|
||||
import vazkii.botania.client.core.helper.ShaderCallback;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelPixie;
|
||||
|
||||
@@ -12,12 +12,12 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.tile.TileCacophonium;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -25,27 +25,27 @@ import javax.annotation.Nonnull;
|
||||
public class BlockCacophonium extends BlockMod {
|
||||
protected BlockCacophonium(Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().with(BotaniaStateProps.POWERED, false));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) {
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.get(BotaniaStateProps.POWERED);
|
||||
boolean powered = state.get(BlockStateProperties.POWERED);
|
||||
|
||||
if (power && !powered) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileCacophonium) {
|
||||
((TileCacophonium) tile).annoyDirewolf();
|
||||
}
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, true), 4);
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, true), 4);
|
||||
} else if (!power && powered) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, false), 4);
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, false), 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.particles.RedstoneParticleData;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.tile.TileEnderEye;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -29,12 +29,12 @@ public class BlockEnderEye extends BlockMod {
|
||||
|
||||
protected BlockEnderEye(Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().with(BotaniaStateProps.POWERED, false));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,7 +44,7 @@ public class BlockEnderEye extends BlockMod {
|
||||
|
||||
@Override
|
||||
public int getWeakPower(BlockState state, IBlockReader world, BlockPos pos, Direction side) {
|
||||
return state.get(BotaniaStateProps.POWERED) ? 15 : 0;
|
||||
return state.get(BlockStateProperties.POWERED) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,7 +60,7 @@ public class BlockEnderEye extends BlockMod {
|
||||
|
||||
@Override
|
||||
public void animateTick(BlockState state, World world, BlockPos pos, Random rand) {
|
||||
if (state.get(BotaniaStateProps.POWERED)) {
|
||||
if (state.get(BlockStateProperties.POWERED)) {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
double x = pos.getX() - 0.1 + Math.random() * 1.2;
|
||||
double y = pos.getY() - 0.1 + Math.random() * 1.2;
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
@@ -35,7 +36,6 @@ import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.mana.IManaTrigger;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.common.block.tile.TileHourglass;
|
||||
@@ -53,7 +53,7 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
|
||||
|
||||
protected BlockHourglass(Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().with(BotaniaStateProps.POWERED, false));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -64,7 +64,7 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,7 +105,7 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
|
||||
|
||||
@Override
|
||||
public int getWeakPower(BlockState state, IBlockReader world, BlockPos pos, Direction side) {
|
||||
return state.get(BotaniaStateProps.POWERED) ? 15 : 0;
|
||||
return state.get(BlockStateProperties.POWERED) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,8 +115,8 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
|
||||
|
||||
@Override
|
||||
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random rand) {
|
||||
if (state.get(BotaniaStateProps.POWERED)) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, false));
|
||||
if (state.get(BlockStateProperties.POWERED)) {
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
@@ -23,7 +24,6 @@ import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.tile.TileLightRelay;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -37,7 +37,7 @@ public class BlockLightLauncher extends BlockMod {
|
||||
|
||||
public BlockLightLauncher(Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().with(BotaniaStateProps.POWERED, false));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -48,19 +48,19 @@ public class BlockLightLauncher extends BlockMod {
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) {
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.get(BotaniaStateProps.POWERED);
|
||||
boolean powered = state.get(BlockStateProperties.POWERED);
|
||||
|
||||
if (power && !powered) {
|
||||
pickUpEntities(world, pos);
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, true), 4);
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, true), 4);
|
||||
} else if (!power && powered) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, false), 4);
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, false), 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
@@ -27,7 +28,6 @@ import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.LuminizerVariant;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.common.block.tile.TileLightRelay;
|
||||
@@ -44,7 +44,7 @@ public class BlockLightRelay extends BlockMod implements IWandable {
|
||||
protected BlockLightRelay(LuminizerVariant variant, Properties builder) {
|
||||
super(builder);
|
||||
this.variant = variant;
|
||||
setDefaultState(stateContainer.getBaseState().with(BotaniaStateProps.POWERED, false));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -55,7 +55,7 @@ public class BlockLightRelay extends BlockMod implements IWandable {
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,17 +72,17 @@ public class BlockLightRelay extends BlockMod implements IWandable {
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) {
|
||||
if (!worldIn.isRemote && variant == LuminizerVariant.TOGGLE) {
|
||||
if (state.get(BotaniaStateProps.POWERED) && !worldIn.isBlockPowered(pos)) {
|
||||
worldIn.setBlockState(pos, state.with(BotaniaStateProps.POWERED, false));
|
||||
} else if (!state.get(BotaniaStateProps.POWERED) && worldIn.isBlockPowered(pos)) {
|
||||
worldIn.setBlockState(pos, state.with(BotaniaStateProps.POWERED, true));
|
||||
if (state.get(BlockStateProperties.POWERED) && !worldIn.isBlockPowered(pos)) {
|
||||
worldIn.setBlockState(pos, state.with(BlockStateProperties.POWERED, false));
|
||||
} else if (!state.get(BlockStateProperties.POWERED) && worldIn.isBlockPowered(pos)) {
|
||||
worldIn.setBlockState(pos, state.with(BlockStateProperties.POWERED, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random rand) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, false));
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,7 +93,7 @@ public class BlockLightRelay extends BlockMod implements IWandable {
|
||||
@Override
|
||||
public int getWeakPower(BlockState state, IBlockReader world, BlockPos pos, Direction s) {
|
||||
return variant == LuminizerVariant.DETECTOR
|
||||
&& state.get(BotaniaStateProps.POWERED) ? 15 : 0;
|
||||
&& state.get(BlockStateProperties.POWERED) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
@@ -24,7 +25,6 @@ import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.tile.TileSimpleInventory;
|
||||
import vazkii.botania.common.block.tile.TileSparkChanger;
|
||||
import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
@@ -38,7 +38,7 @@ public class BlockSparkChanger extends BlockMod {
|
||||
|
||||
public BlockSparkChanger(Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().with(BotaniaStateProps.POWERED, true));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.POWERED, true));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -49,19 +49,19 @@ public class BlockSparkChanger extends BlockMod {
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) {
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.get(BotaniaStateProps.POWERED);
|
||||
boolean powered = state.get(BlockStateProperties.POWERED);
|
||||
|
||||
if (power && !powered) {
|
||||
((TileSparkChanger) world.getTileEntity(pos)).doSwap();
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, true), 4);
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, true), 4);
|
||||
} else if (!power && powered) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, false), 4);
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, false), 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@ package vazkii.botania.common.block.corporea;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaBase;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaFunnel;
|
||||
|
||||
@@ -25,24 +25,24 @@ public class BlockCorporeaFunnel extends BlockCorporeaBase {
|
||||
|
||||
public BlockCorporeaFunnel(Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().with(BotaniaStateProps.POWERED, false));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) {
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.get(BotaniaStateProps.POWERED);
|
||||
boolean powered = state.get(BlockStateProperties.POWERED);
|
||||
|
||||
if (power && !powered) {
|
||||
((TileCorporeaFunnel) world.getTileEntity(pos)).doRequest();
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, true), 4);
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, true), 4);
|
||||
} else if (!power && powered) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, false), 4);
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, false), 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ package vazkii.botania.common.block.corporea;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaBase;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaInterceptor;
|
||||
|
||||
@@ -29,17 +29,17 @@ public class BlockCorporeaInterceptor extends BlockCorporeaBase {
|
||||
|
||||
public BlockCorporeaInterceptor(Block.Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().with(BotaniaStateProps.POWERED, false));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random rand) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, false));
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,7 +49,7 @@ public class BlockCorporeaInterceptor extends BlockCorporeaBase {
|
||||
|
||||
@Override
|
||||
public int getWeakPower(BlockState state, IBlockReader world, BlockPos pos, Direction side) {
|
||||
return state.get(BotaniaStateProps.POWERED) ? 15 : 0;
|
||||
return state.get(BlockStateProperties.POWERED) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,12 +11,12 @@ package vazkii.botania.common.block.corporea;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaRetainer;
|
||||
|
||||
@@ -26,24 +26,24 @@ public class BlockCorporeaRetainer extends BlockMod {
|
||||
|
||||
public BlockCorporeaRetainer(Block.Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().with(BotaniaStateProps.POWERED, false));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) {
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.get(BotaniaStateProps.POWERED);
|
||||
boolean powered = state.get(BlockStateProperties.POWERED);
|
||||
|
||||
if (power && !powered) {
|
||||
((TileCorporeaRetainer) world.getTileEntity(pos)).fulfilRequest();
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, true));
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, true));
|
||||
} else if (!power && powered) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, false));
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
@@ -27,7 +28,6 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.block.tile.TileBrewery;
|
||||
@@ -42,12 +42,12 @@ public class BlockBrewery extends BlockMod implements IWandHUD {
|
||||
|
||||
public BlockBrewery(Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().with(BotaniaStateProps.POWERED, false));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -61,7 +61,7 @@ public class BlockBrewery extends BlockMod implements IWandHUD {
|
||||
TileBrewery brew = (TileBrewery) world.getTileEntity(pos);
|
||||
|
||||
if (player.isSneaking()) {
|
||||
if (brew.recipe == null && !state.get(BotaniaStateProps.POWERED)) {
|
||||
if (brew.recipe == null && !state.get(BlockStateProperties.POWERED)) {
|
||||
InventoryHelper.withdrawFromInventory(brew, player);
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.block.mana;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -22,7 +23,6 @@ import net.minecraft.world.World;
|
||||
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.mana.IManaCollisionGhost;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.block.tile.mana.TileManaDetector;
|
||||
|
||||
@@ -32,12 +32,12 @@ public class BlockManaDetector extends BlockMod implements IManaCollisionGhost {
|
||||
|
||||
public BlockManaDetector(Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().with(BotaniaStateProps.POWERED, false));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,7 +47,7 @@ public class BlockManaDetector extends BlockMod implements IManaCollisionGhost {
|
||||
|
||||
@Override
|
||||
public int getWeakPower(BlockState state, IBlockReader world, BlockPos pos, Direction side) {
|
||||
return state.get(BotaniaStateProps.POWERED) ? 15 : 0;
|
||||
return state.get(BlockStateProperties.POWERED) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
@@ -42,7 +43,7 @@ public class BlockPrism extends BlockMod implements IManaTrigger, IManaCollision
|
||||
public BlockPrism(Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState()
|
||||
.with(BotaniaStateProps.POWERED, false)
|
||||
.with(BlockStateProperties.POWERED, false)
|
||||
.with(BotaniaStateProps.HAS_LENS, false));
|
||||
}
|
||||
|
||||
@@ -54,7 +55,7 @@ public class BlockPrism extends BlockMod implements IManaTrigger, IManaCollision
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED, BotaniaStateProps.HAS_LENS);
|
||||
builder.add(BlockStateProperties.POWERED, BotaniaStateProps.HAS_LENS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -86,13 +87,13 @@ public class BlockPrism extends BlockMod implements IManaTrigger, IManaCollision
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) {
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.get(BotaniaStateProps.POWERED);
|
||||
boolean powered = state.get(BlockStateProperties.POWERED);
|
||||
|
||||
if (!world.isRemote) {
|
||||
if (power && !powered) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, true));
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, true));
|
||||
} else if (!power && powered) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, false));
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.tile.string.TileRedString;
|
||||
import vazkii.botania.common.block.tile.string.TileRedStringDispenser;
|
||||
|
||||
@@ -27,25 +26,25 @@ public class BlockRedStringDispenser extends BlockRedString {
|
||||
|
||||
public BlockRedStringDispenser(Block.Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.FACING, Direction.DOWN).with(BotaniaStateProps.POWERED, false));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.FACING, Direction.DOWN).with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) {
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.get(BotaniaStateProps.POWERED);
|
||||
boolean powered = state.get(BlockStateProperties.POWERED);
|
||||
|
||||
if (power && !powered) {
|
||||
((TileRedStringDispenser) world.getTileEntity(pos)).tickDispenser();
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, true), 4);
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, true), 4);
|
||||
} else if (!power && powered) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, false), 4);
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, false), 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.tile.string.TileRedString;
|
||||
import vazkii.botania.common.block.tile.string.TileRedStringInterceptor;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -35,13 +34,13 @@ public class BlockRedStringInterceptor extends BlockRedString {
|
||||
|
||||
public BlockRedStringInterceptor(Block.Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.FACING, Direction.DOWN).with(BotaniaStateProps.POWERED, false));
|
||||
setDefaultState(stateContainer.getBaseState().with(BlockStateProperties.FACING, Direction.DOWN).with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
builder.add(BlockStateProperties.POWERED);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -56,12 +55,12 @@ public class BlockRedStringInterceptor extends BlockRedString {
|
||||
|
||||
@Override
|
||||
public int getWeakPower(BlockState state, IBlockReader world, BlockPos pos, Direction side) {
|
||||
return state.get(BotaniaStateProps.POWERED) ? 15 : 0;
|
||||
return state.get(BlockStateProperties.POWERED) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random update) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, false));
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,8 +12,8 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Hand;
|
||||
@@ -28,7 +28,6 @@ import vazkii.botania.api.brew.IBrewItem;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.mana.IManaReceiver;
|
||||
import vazkii.botania.api.recipe.RecipeBrew;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
@@ -96,7 +95,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver, I
|
||||
Optional<RecipeBrew> maybeRecipe = world.getRecipeManager().getRecipe(ModRecipeTypes.BREW_TYPE, new RecipeWrapper(itemHandler), world);
|
||||
maybeRecipe.ifPresent(recipeBrew -> {
|
||||
this.recipe = recipeBrew;
|
||||
world.setBlockState(pos, ModBlocks.brewery.getDefaultState().with(BotaniaStateProps.POWERED, true));
|
||||
world.setBlockState(pos, ModBlocks.brewery.getDefaultState().with(BlockStateProperties.POWERED, true));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
@@ -20,7 +21,6 @@ import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.item.equipment.tool.ToolCommons;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -40,7 +40,7 @@ public class TileEnderEye extends TileMod implements ITickableTileEntity {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean wasLooking = getBlockState().get(BotaniaStateProps.POWERED);
|
||||
boolean wasLooking = getBlockState().get(BlockStateProperties.POWERED);
|
||||
int range = 80;
|
||||
List<PlayerEntity> players = world.getEntitiesWithinAABB(PlayerEntity.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range, range, range)));
|
||||
|
||||
@@ -59,7 +59,7 @@ public class TileEnderEye extends TileMod implements ITickableTileEntity {
|
||||
}
|
||||
|
||||
if (looking != wasLooking) {
|
||||
world.setBlockState(getPos(), getBlockState().with(BotaniaStateProps.POWERED, looking));
|
||||
world.setBlockState(getPos(), getBlockState().with(BlockStateProperties.POWERED, looking));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
@@ -25,7 +26,6 @@ import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.item.IHourglassTrigger;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -73,7 +73,7 @@ public class TileHourglass extends TileSimpleInventory implements ITickableTileE
|
||||
flip = !flip;
|
||||
flipTicks = 4;
|
||||
if (!world.isRemote) {
|
||||
world.setBlockState(getPos(), getBlockState().with(BotaniaStateProps.POWERED, true), 1);
|
||||
world.setBlockState(getPos(), getBlockState().with(BlockStateProperties.POWERED, true), 1);
|
||||
world.getPendingBlockTicks().scheduleTick(pos, getBlockState().getBlock(), getBlockState().getBlock().tickRate(world));
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.network.IPacket;
|
||||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
@@ -35,7 +36,6 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.network.NetworkHooks;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.wand.IWandBindable;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
@@ -190,7 +190,7 @@ public class TileLightRelay extends TileMod implements ITickableTileEntity, IWan
|
||||
|
||||
public BlockPos getNextDestination() {
|
||||
BlockState state = getBlockState();
|
||||
if (state.getBlock() == ModBlocks.lightRelayToggle && state.get(BotaniaStateProps.POWERED)) {
|
||||
if (state.getBlock() == ModBlocks.lightRelayToggle && state.get(BlockStateProperties.POWERED)) {
|
||||
return null;
|
||||
} else if (state.getBlock() == ModBlocks.lightRelayFork) {
|
||||
BlockPos torchPos = null;
|
||||
@@ -297,7 +297,7 @@ public class TileLightRelay extends TileMod implements ITickableTileEntity, IWan
|
||||
if (tile instanceof TileLightRelay) {
|
||||
BlockState state = world.getBlockState(pos);
|
||||
if (state.getBlock() == ModBlocks.lightRelayDetector) {
|
||||
world.setBlockState(pos, state.with(BotaniaStateProps.POWERED, true));
|
||||
world.setBlockState(pos, state.with(BlockStateProperties.POWERED, true));
|
||||
world.getPendingBlockTicks().scheduleTick(pos, state.getBlock(), state.getBlock().tickRate(world));
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.tile.corporea;
|
||||
|
||||
import net.minecraft.entity.item.ItemFrameEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
@@ -20,7 +21,6 @@ import vazkii.botania.api.corporea.ICorporeaInterceptor;
|
||||
import vazkii.botania.api.corporea.ICorporeaRequestMatcher;
|
||||
import vazkii.botania.api.corporea.ICorporeaSpark;
|
||||
import vazkii.botania.api.corporea.InvWithLocation;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@@ -47,8 +47,8 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor
|
||||
missing -= stack_.getCount();
|
||||
}
|
||||
|
||||
if (missing > 0 && !getBlockState().get(BotaniaStateProps.POWERED)) {
|
||||
world.setBlockState(getPos(), getBlockState().with(BotaniaStateProps.POWERED, true));
|
||||
if (missing > 0 && !getBlockState().get(BlockStateProperties.POWERED)) {
|
||||
world.setBlockState(getPos(), getBlockState().with(BlockStateProperties.POWERED, true));
|
||||
world.getPendingBlockTicks().scheduleTick(getPos(), getBlockState().getBlock(), getBlockState().getBlock().tickRate(world));
|
||||
|
||||
TileEntity requestor = source.getSparkInventory().getWorld().getTileEntity(source.getSparkInventory().getPos());
|
||||
|
||||
@@ -11,13 +11,13 @@ package vazkii.botania.common.block.tile.mana;
|
||||
import com.google.common.base.Predicates;
|
||||
|
||||
import net.minecraft.entity.projectile.ThrowableEntity;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -32,10 +32,10 @@ public class TileManaDetector extends TileMod implements ITickableTileEntity {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
boolean state = getBlockState().get(BotaniaStateProps.POWERED);
|
||||
boolean state = getBlockState().get(BlockStateProperties.POWERED);
|
||||
boolean expectedState = world.getEntitiesWithinAABB(ThrowableEntity.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)), Predicates.instanceOf(IManaBurst.class)).size() != 0;
|
||||
if (state != expectedState && !world.isRemote) {
|
||||
world.setBlockState(getPos(), getBlockState().with(BotaniaStateProps.POWERED, expectedState));
|
||||
world.setBlockState(getPos(), getBlockState().with(BlockStateProperties.POWERED, expectedState));
|
||||
}
|
||||
|
||||
if (expectedState) {
|
||||
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.block.tile.mana;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
@@ -36,7 +37,7 @@ public class TilePrism extends TileSimpleInventory {
|
||||
|
||||
public void onBurstCollision(IManaBurst burst) {
|
||||
ItemStack lens = itemHandler.getStackInSlot(0);
|
||||
boolean active = !getBlockState().get(BotaniaStateProps.POWERED);
|
||||
boolean active = !getBlockState().get(BlockStateProperties.POWERED);
|
||||
boolean valid = !lens.isEmpty() && lens.getItem() instanceof ILens && (!(lens.getItem() instanceof ITinyPlanetExcempt) || ((ITinyPlanetExcempt) lens.getItem()).shouldPull(lens));
|
||||
|
||||
if (active) {
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.tile.string;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
@@ -18,7 +19,6 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@@ -70,7 +70,7 @@ public class TileRedStringInterceptor extends TileRedString {
|
||||
BlockPos coords = inter.getBinding();
|
||||
if (coords != null && coords.equals(pos)) {
|
||||
Block block = inter.getBlockState().getBlock();
|
||||
world.setBlockState(inter.getPos(), world.getBlockState(inter.getPos()).with(BotaniaStateProps.POWERED, true));
|
||||
world.setBlockState(inter.getPos(), world.getBlockState(inter.getPos()).with(BlockStateProperties.POWERED, true));
|
||||
world.getPendingBlockTicks().scheduleTick(inter.getPos(), block, block.tickRate(world));
|
||||
did = true;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
import net.minecraftforge.fml.network.NetworkHooks;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.internal.ShaderCallback;
|
||||
import vazkii.botania.client.core.helper.ShaderCallback;
|
||||
import vazkii.botania.client.core.handler.BossBarHandler;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
|
||||
@@ -29,7 +29,6 @@ import net.minecraftforge.client.model.generators.ConfiguredModel;
|
||||
import net.minecraftforge.client.model.generators.ExistingFileHelper;
|
||||
import net.minecraftforge.client.model.generators.ModelFile;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.BlockAltGrass;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.decor.BlockPetalBlock;
|
||||
@@ -131,8 +130,8 @@ public class BlockstateProvider extends BlockStateProvider {
|
||||
} else if (b == ModBlocks.enderEye || b == ModBlocks.manaDetector) {
|
||||
ModelFile offFile = models().getExistingFile(prefix("block/" + name));
|
||||
ModelFile onFile = models().getExistingFile(prefix("block/" + name + "_powered"));
|
||||
getVariantBuilder(b).partialState().with(BotaniaStateProps.POWERED, false).setModels(new ConfiguredModel(offFile));
|
||||
getVariantBuilder(b).partialState().with(BotaniaStateProps.POWERED, true).setModels(new ConfiguredModel(onFile));
|
||||
getVariantBuilder(b).partialState().with(BlockStateProperties.POWERED, false).setModels(new ConfiguredModel(offFile));
|
||||
getVariantBuilder(b).partialState().with(BlockStateProperties.POWERED, true).setModels(new ConfiguredModel(onFile));
|
||||
} else if (b == ModBlocks.tinyPotato || b == ModBlocks.felPumpkin || b == ModBlocks.pump) {
|
||||
ModelFile file = models().getExistingFile(prefix("block/" + name));
|
||||
horizontalBlock(b, file);
|
||||
|
||||
Reference in new issue
Block a user