Misc fixes around

This commit is contained in:
Vincent Lee committed 2019-06-08 18:47:15 -07:00
1 parent ee08a279a7
commit cce2f81d15
67 files changed
+198 -173

No files matched your search

@@ -25,6 +25,7 @@ import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.profiler.IProfiler;
import net.minecraft.profiler.Profiler;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
@@ -374,7 +375,7 @@ public final class HUDHandler {
private static void drawLexiconHUD(ItemStack stack, BlockState state, RayTraceResult pos) {
Minecraft mc = Minecraft.getInstance();
Block block = state.getBlock();
Profiler profiler = mc.profiler;
IProfiler profiler = mc.getProfiler();
profiler.startSection("lexicon");
FontRenderer font = mc.fontRenderer;
@@ -30,7 +30,7 @@ public class RenderTileAltar extends TileEntityRenderer<TileAltar> {
@Override
public void render(@Nonnull TileAltar altar, double d0, double d1, double d2, float pticks, int digProgress) {
if(!altar.getWorld().isBlockLoaded(altar.getPos(), false))
if(!altar.getWorld().isBlockLoaded(altar.getPos()))
return;
GlStateManager.pushMatrix();
@@ -18,7 +18,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.block.Blocks;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.HoeItem;
import net.minecraft.item.Item;
import net.minecraft.item.HoeItem;
@@ -31,6 +31,7 @@ import net.minecraft.util.IStringSerializable;
import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
@@ -75,7 +76,7 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction facing, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ItemStack held = player.getHeldItem(hand);
if(held.getItem() instanceof HoeItem && world.isAirBlock(pos.up())) {
held.damageItem(1, player);
@@ -123,7 +124,7 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
break;
case SCORCHED:
if(r.nextInt(80) == 0)
world.addParticle(Particles.FLAME, pos.getX() + r.nextFloat(), pos.getY() + 1.1, pos.getZ() + r.nextFloat(), 0, 0, 0);
world.addParticle(ParticleTypes.FLAME, pos.getX() + r.nextFloat(), pos.getY() + 1.1, pos.getZ() + r.nextFloat(), 0, 0, 0);
break;
case INFUSED:
if(r.nextInt(100) == 0)
@@ -32,6 +32,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.IBooleanFunction;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
@@ -136,7 +137,7 @@ public class BlockAltar extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction par6, float par7, float par8, float par9) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
TileAltar tile = (TileAltar) world.getTileEntity(pos);
ItemStack stack = player.getHeldItem(hand);
if(player.isSneaking()) {
@@ -24,6 +24,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -52,7 +53,7 @@ public class BlockAnimatedTorch extends BlockMod implements IWandable, IManaTrig
}
@Override
public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockRayTraceResult hit) {
if(hand == Hand.MAIN_HAND && playerIn.isSneaking() && playerIn.getHeldItem(hand).isEmpty()) {
((TileAnimatedTorch) worldIn.getTileEntity(pos)).handRotate();
return true;
@@ -23,6 +23,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -64,7 +65,7 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction s, float xs, float ys, float zs) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
TileAvatar avatar = (TileAvatar) world.getTileEntity(pos);
ItemStack stackOnAvatar = avatar.getItemHandler().getStackInSlot(0);
ItemStack stackOnPlayer = player.getHeldItem(hand);
@@ -22,6 +22,7 @@ import net.minecraft.block.BlockRenderType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.World;
import vazkii.botania.common.block.tile.TileCamo;
@@ -36,7 +37,7 @@ public abstract class BlockCamo extends BlockMod {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
TileEntity tile = world.getTileEntity(pos);
if(world.isRemote)
@@ -47,7 +48,7 @@ public abstract class BlockCamo extends BlockMod {
&& Block.getBlockFromItem(currentStack.getItem()) != null
&& tile instanceof TileCamo) {
TileCamo camo = (TileCamo) tile;
BlockItemUseContext ctx = new BlockItemUseContext(world, player, currentStack, pos, side, 0, 0, 0);
BlockItemUseContext ctx = new BlockItemUseContext(world, player, hand, currentStack, hit);
BlockState changeState = Block.getBlockFromItem(currentStack.getItem()).getStateForPlacement(ctx);
if(isValidBlock(changeState, world, pos) && !(changeState.getBlock() instanceof BlockCamo) && changeState.getMaterial() != Material.AIR) {
@@ -18,7 +18,7 @@ import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
@@ -30,6 +30,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -82,7 +83,7 @@ public class BlockCocoon extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction s, float xs, float ys, float zs) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ItemStack stack = player.getHeldItem(hand);
return addStack(world, pos, stack, player.abilities.isCreativeMode);
}
@@ -97,12 +98,12 @@ public class BlockCocoon extends BlockMod implements ILexiconable {
if(!creative)
stack.shrink(1);
cocoon.emeraldsGiven++;
((ServerWorld) world).spawnParticle(Particles.HAPPY_VILLAGER, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 1, 0, 0, 0, 0.5);
((ServerWorld) world).spawnParticle(ParticleTypes.HAPPY_VILLAGER, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 1, 0, 0, 0, 0.5);
} else if(item == Items.CHORUS_FRUIT && cocoon.chorusFruitGiven < TileCocoon.MAX_CHORUS_FRUITS) {
if(!creative)
stack.shrink(1);
cocoon.chorusFruitGiven++;
((ServerWorld) world).spawnParticle(Particles.PORTAL, pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, 32, 0, 0, 0, 0.5);
((ServerWorld) world).spawnParticle(ParticleTypes.PORTAL, pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, 32, 0, 0, 0, 0.5);
}
}
@@ -25,8 +25,8 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.PlantType;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.common.lexicon.LexiconData;
@@ -49,12 +49,7 @@ public class BlockEnchantedSoil extends BlockMod implements ILexiconable {
@Override
public boolean canSustainPlant(@Nonnull BlockState state, @Nonnull IBlockReader world, BlockPos pos, @Nonnull Direction direction, IPlantable plantable) {
return plantable.getPlantType(world, pos.down()) == EnumPlantType.Plains;
}
@Override
public boolean canSilkHarvest(@Nonnull BlockState state, IWorldReader world, BlockPos pos, PlayerEntity player) {
return false;
return plantable.getPlantType(world, pos.down()) == PlantType.Plains;
}
@Override
@@ -28,6 +28,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IEnviromentBlockReader;
import net.minecraft.world.IWorldReader;
@@ -135,8 +136,8 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
return ((TileEntitySpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ) || super.onBlockActivated(state, world, pos, player, hand, side, hitX, hitY, hitZ);
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
return ((TileEntitySpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ) || super.onBlockActivated(state, world, pos, player, hand, hit);
}
@Override
@@ -26,6 +26,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.text.TranslationTextComponent;
@@ -78,7 +79,7 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction side, float xs, float ys, float zs) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
TileHourglass hourglass = (TileHourglass) world.getTileEntity(pos);
ItemStack hgStack = hourglass.getItemHandler().getStackInSlot(0);
ItemStack stack = player.getHeldItem(hand);
@@ -26,6 +26,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -56,7 +57,7 @@ public class BlockIncensePlate extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction s, float xs, float ys, float zs) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
TileIncensePlate plate = (TileIncensePlate) world.getTileEntity(pos);
ItemStack plateStack = plate.getItemHandler().getStackInSlot(0);
ItemStack stack = player.getHeldItem(hand);
@@ -22,6 +22,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -62,7 +63,7 @@ public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction s, float xs, float ys, float zs) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
((TileLightRelay) world.getTileEntity(pos)).mountEntity(player);
return true;
}
@@ -24,6 +24,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -79,7 +80,7 @@ public class BlockSparkChanger extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction s, float xs, float ys, float zs) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
TileSparkChanger changer = (TileSparkChanger) world.getTileEntity(pos);
ItemStack pstack = player.getHeldItem(hand);
ItemStack cstack = changer.getItemHandler().getStackInSlot(0);
@@ -31,6 +31,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.shapes.ISelectionContext;
@@ -180,7 +181,7 @@ public class BlockSpecialFlower extends FlowerBlock implements ISpecialFlower, I
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ItemStack stack = player.getHeldItem(hand);
if(!stack.isEmpty() && stack.getItem() instanceof ItemDye) {
DyeColor newColor = ((ItemDye) stack.getItem()).color;
@@ -28,6 +28,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -66,7 +67,7 @@ public class BlockTeruTeruBozu extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction s, float xs, float ys, float zs) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ItemStack stack = player.getHeldItem(hand);
if(!stack.isEmpty() && (isSunflower(stack) && removeRain(world) || isBlueOrchid(stack) && startRain(world))) {
if(!player.abilities.isCreativeMode)
@@ -23,6 +23,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -60,7 +61,7 @@ public class BlockCorporeaCrystalCube extends BlockCorporeaBase implements ILexi
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction s, float xs, float ys, float zs) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ItemStack stack = player.getHeldItem(hand);
if(!stack.isEmpty()) {
if(stack.getItem() == ModItems.twigWand && player.isSneaking())
@@ -22,7 +22,7 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.particles.BlockParticleData;
@@ -86,7 +86,7 @@ public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconabl
d0 = 2.5D;
}
int i = (int)(150.0D * d0);
world.spawnParticle(new BlockParticleData(Particles.BLOCK, ModBlocks.elementiumBlock.getDefaultState()), entity.posX, entity.posY, entity.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D);
world.spawnParticle(new BlockParticleData(ParticleTypes.BLOCK, ModBlocks.elementiumBlock.getDefaultState()), entity.posX, entity.posY, entity.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D);
return true;
}
@@ -103,7 +103,7 @@ public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconabl
double d0 = pos.getX() + (j + 0.5D) / i;
double d1 = pos.getY() + (k + 0.5D) / i;
double d2 = pos.getZ() + (l + 0.5D) / i;
effectRenderer.addEffect(factory.makeParticle(new BlockParticleData(Particles.BLOCK, ModBlocks.elementiumBlock.getDefaultState()), world, d0, d1, d2, d0 - pos.getX() - 0.5D, d1 - pos.getY() - 0.5D, d2 - pos.getZ() - 0.5D));
effectRenderer.addEffect(factory.makeParticle(new BlockParticleData(ParticleTypes.BLOCK, ModBlocks.elementiumBlock.getDefaultState()), world, d0, d1, d2, d0 - pos.getX() - 0.5D, d1 - pos.getY() - 0.5D, d2 - pos.getZ() - 0.5D));
}
}
}
@@ -30,6 +30,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -101,7 +102,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ItemStack stack = player.getHeldItem(hand);
if(!stack.isEmpty()) {
IFloatingFlower flower = (IFloatingFlower) world.getTileEntity(pos);
@@ -25,6 +25,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -66,7 +67,7 @@ public class BlockManaFlame extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction s, float xs, float ys, float zs) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
if(Botania.gardenOfGlassLoaded) {
ItemStack stack = player.getHeldItem(hand);
if(!stack.isEmpty() && ItemTags.SAPLINGS.contains(stack.getItem()) && !player.inventory.hasItemStack(new ItemStack(ModItems.lexicon))) {
@@ -18,7 +18,7 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.IFluidState;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack;
import net.minecraft.state.StateContainer;
@@ -31,6 +31,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.text.ITextComponent;
@@ -78,12 +79,12 @@ public class BlockTinyPotato extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction par6, float par7, float par8, float par9) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
TileEntity tile = world.getTileEntity(pos);
if(tile instanceof TileTinyPotato) {
((TileTinyPotato) tile).interact(player, hand, player.getHeldItem(hand), par6);
((TileTinyPotato) tile).interact(player, hand, player.getHeldItem(hand), hit.getFace());
AxisAlignedBB box = SHAPE.getBoundingBox();
world.addParticle(Particles.HEART, pos.getX() + box.minX + Math.random() * (box.maxX - box.minX), pos.getY() + box.maxY, pos.getZ() + box.minZ + Math.random() * (box.maxZ - box.minZ), 0, 0 ,0);
world.addParticle(ParticleTypes.HEART, pos.getX() + box.minX + Math.random() * (box.maxX - box.minX), pos.getY() + box.maxY, pos.getZ() + box.minZ + Math.random() * (box.maxZ - box.minZ), 0, 0 ,0);
}
return true;
}
@@ -28,6 +28,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -68,7 +69,7 @@ public class BlockBellows extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction s, float xs, float ys, float zs) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
if(EntityDoppleganger.isTruePlayer(player))
((TileBellows) world.getTileEntity(pos)).interact();
return true;
@@ -21,6 +21,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -60,7 +61,7 @@ public class BlockBrewery extends BlockMod implements ILexiconable, IWandHUD {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction side, float par7, float par8, float par9) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
TileBrewery brew = (TileBrewery) world.getTileEntity(pos);
if(player.isSneaking()) {
@@ -32,6 +32,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Hand;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
@@ -82,7 +83,7 @@ public class BlockEnchanter extends BlockMod implements IWandable, ILexiconable,
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction side, float par7, float par8, float par9) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
TileEnchanter enchanter = (TileEnchanter) world.getTileEntity(pos);
ItemStack stack = player.getHeldItem(hand);
if(!stack.isEmpty() && stack.getItem() == ModItems.twigWand)
@@ -17,7 +17,7 @@ import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.passive.CowEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.util.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
@@ -76,7 +76,7 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
if(burst.isFake())
return;
if(world.isRemote) {
world.addParticle(Particles.NOTE, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5D, 1.0 / 24.0, 0, 0);
world.addParticle(ParticleTypes.NOTE, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5D, 1.0 / 24.0, 0, 0);
return;
}
if(variant == Variant.WILD)
@@ -24,6 +24,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -80,7 +81,7 @@ public class BlockPrism extends BlockMod implements IManaTrigger, ILexiconable,
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction side, float par7, float par8, float par9) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
TileEntity tile = world.getTileEntity(pos);
if(!(tile instanceof TilePrism))
return false;
@@ -104,7 +105,7 @@ public class BlockPrism extends BlockMod implements IManaTrigger, ILexiconable,
}
@Override
public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) {
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);
@@ -23,6 +23,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -60,7 +61,7 @@ public class BlockRuneAltar extends BlockMod implements IWandable, ILexiconable
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction side, float par7, float par8, float par9) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
if(world.isRemote)
return true;
@@ -36,6 +36,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IBlockReader;
@@ -122,7 +123,7 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction par6, float par7, float par8, float par9) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
TileEntity tile = world.getTileEntity(pos);
if(!(tile instanceof TileSpreader))
return false;
@@ -27,6 +27,8 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -58,7 +60,7 @@ public class BlockTerraPlate extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction s, float xs, float ys, float zs) {
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ItemStack stack = player.getHeldItem(hand);
if(!stack.isEmpty()
&& (stack.getItem() == ModItems.manaSteel || stack.getItem() == ModItems.manaPearl || stack.getItem() == ModItems.manaDiamond)) {
@@ -66,7 +68,7 @@ public class BlockTerraPlate extends BlockMod implements ILexiconable {
ItemStack target = stack.split(1);
ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, target);
item.setPickupDelay(40);
item.motionX = item.motionY = item.motionZ = 0;
item.setMotion(Vec3d.ZERO);
world.spawnEntity(item);
}
@@ -14,7 +14,7 @@ import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundNBT;
@@ -58,7 +58,7 @@ public class SubTileEndoflame extends TileEntityGeneratingFlower {
if(getWorld().isRemote) {
if(burnTime > 0 && getWorld().rand.nextInt(10) == 0) {
Vec3d offset = getWorld().getBlockState(getPos()).getOffset(getWorld(), getPos()).add(0.4, 0.7, 0.4);
getWorld().addParticle(Particles.FLAME, getPos().getX() + offset.x + Math.random() * 0.2, getPos().getY() + offset.y, getPos().getZ() + offset.z + Math.random() * 0.2, 0.0D, 0.0D, 0.0D);
getWorld().addParticle(ParticleTypes.FLAME, getPos().getX() + offset.x + Math.random() * 0.2, getPos().getY() + offset.y, getPos().getZ() + offset.z + Math.random() * 0.2, 0.0D, 0.0D, 0.0D);
}
return;
}
@@ -97,8 +97,8 @@ public class SubTileEndoflame extends TileEntityGeneratingFlower {
if(event == START_BURN_EVENT) {
Entity e = getWorld().getEntityByID(param);
if(e != null) {
e.world.addParticle(Particles.LARGE_SMOKE, e.posX, e.posY + 0.1, e.posZ, 0.0D, 0.0D, 0.0D);
e.world.addParticle(Particles.FLAME, e.posX, e.posY, e.posZ, 0.0D, 0.0D, 0.0D);
e.world.addParticle(ParticleTypes.LARGE_SMOKE, e.posX, e.posY + 0.1, e.posZ, 0.0D, 0.0D, 0.0D);
e.world.addParticle(ParticleTypes.FLAME, e.posX, e.posY, e.posZ, 0.0D, 0.0D, 0.0D);
}
return true;
} else {
@@ -13,7 +13,7 @@ package vazkii.botania.common.block.subtile.generating;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.TNTEntity;
import net.minecraft.entity.item.TNTEntity;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.util.SoundEvents;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.SoundEvents;
@@ -70,7 +70,7 @@ public class SubTileEntropinnyum extends TileEntityGeneratingFlower {
for(int i = 0; i < 50; i++)
Botania.proxy.sparkleFX(e.posX + Math.random() * 4 - 2, e.posY + Math.random() * 4 - 2, e.posZ + Math.random() * 4 - 2, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, (float) (Math.random() * 0.65F + 1.25F), 12);
getWorld().addParticle(Particles.EXPLOSION_EMITTER, e.posX, e.posY, e.posZ, 1D, 0D, 0D);
getWorld().addParticle(ParticleTypes.EXPLOSION_EMITTER, e.posX, e.posY, e.posZ, 1D, 0D, 0D);
}
return true;
} else {
@@ -12,10 +12,9 @@ package vazkii.botania.common.block.subtile.generating;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.SoundEvents;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.particles.ItemParticleData;
@@ -80,7 +79,7 @@ public class SubTileGourmaryllis extends TileEntityGeneratingFlower {
Vec3d offset = getWorld().getBlockState(getPos()).getOffset(getWorld(), getPos()).add(0.4, 0.6, 0.4);
((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(Particles.ITEM, lastFood), getPos().getX()+offset.x, getPos().getY()+offset.y, getPos().getZ()+offset.z, 10, 0.1D, 0.1D, 0.1D, 0.03D);
((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(ParticleTypes.ITEM, lastFood), getPos().getX()+offset.x, getPos().getY()+offset.y, getPos().getZ()+offset.z, 10, 0.1D, 0.1D, 0.1D, 0.03D);
}
}
@@ -107,7 +106,7 @@ public class SubTileGourmaryllis extends TileEntityGeneratingFlower {
cooldown = val * 10;
item.playSound(SoundEvents.ENTITY_GENERIC_EAT, 0.2F, 0.6F);
sync();
((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(Particles.ITEM, stack), item.posX, item.posY, item.posZ, 20, 0.1D, 0.1D, 0.1D, 0.05D);
((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(ParticleTypes.ITEM, stack), item.posX, item.posY, item.posZ, 20, 0.1D, 0.1D, 0.1D, 0.05D);
}
item.remove();
@@ -11,7 +11,7 @@
package vazkii.botania.common.block.subtile.generating;
import net.minecraft.entity.monster.SlimeEntity;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.util.SoundEvents;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.SharedSeedRandom;
@@ -72,7 +72,7 @@ public class SubTileNarslimmus extends TileEntityGeneratingFlower {
float f2 = MathHelper.sin(f) * size * 0.5F * f1;
float f3 = MathHelper.cos(f) * size * 0.5F * f1;
float f4 = slime.world.rand.nextFloat() * size * 0.5F * f1;
slime.world.addParticle(Particles.ITEM_SLIME, slime.posX + f2, slime.getBoundingBox().minY + f4, slime.posZ + f3, 0.0D, 0.0D, 0.0D);
slime.world.addParticle(ParticleTypes.ITEM_SLIME, slime.posX + f2, slime.getBoundingBox().minY + f4, slime.posZ + f3, 0.0D, 0.0D, 0.0D);
}
break;
}
@@ -8,7 +8,7 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.monster.ShulkerEntity;
import net.minecraft.entity.monster.IMob;
import net.minecraft.potion.Effects;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.util.SoundEvents;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.SoundCategory;
@@ -71,8 +71,8 @@ public class SubTileShulkMeNot extends TileEntityGeneratingFlower {
private void particles(World world, BlockPos pos, Entity entity) {
if(world instanceof ServerWorld) {
ServerWorld ws = (ServerWorld) world;
ws.spawnParticle(Particles.EXPLOSION, entity.posX + entity.width / 2, entity.posY + entity.height / 2, entity.posZ + entity.width / 2, 100, entity.width, entity.height, entity.width, 0.05);
ws.spawnParticle(Particles.PORTAL, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 40, 0, 0, 0, 0.6);
ws.spawnParticle(ParticleTypes.EXPLOSION, entity.posX + entity.width / 2, entity.posY + entity.height / 2, entity.posZ + entity.width / 2, 100, entity.width, entity.height, entity.width, 0.05);
ws.spawnParticle(ParticleTypes.PORTAL, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 40, 0, 0, 0, 0.6);
}
}
@@ -15,7 +15,7 @@ import net.minecraft.client.Minecraft;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.DyeColor;
import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemStack;
@@ -76,7 +76,7 @@ public class SubTileSpectrolus extends TileEntityGeneratingFlower {
nextColor = nextColor == DyeColor.BLACK ? DyeColor.WHITE : DyeColor.values()[nextColor.ordinal() + 1];
sync();
((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(Particles.ITEM, stack), item.posX, item.posY, item.posZ, 20, 0.1D, 0.1D, 0.1D, 0.05D);
((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(ParticleTypes.ITEM, stack), item.posX, item.posY, item.posZ, 20, 0.1D, 0.1D, 0.1D, 0.05D);
}
item.remove();
@@ -22,7 +22,7 @@ import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.block.Blocks;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Items;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.SoundEvents;
import net.minecraft.item.Item;
@@ -278,9 +278,9 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary,
}
if(hasLava()) {
world.addParticle(Particles.SMOKE, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.05, 0);
world.addParticle(ParticleTypes.SMOKE, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.05, 0);
if(Math.random() > 0.9)
world.addParticle(Particles.LAVA, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.01, 0);
world.addParticle(ParticleTypes.LAVA, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.01, 0);
}
}
@@ -12,7 +12,9 @@ package vazkii.botania.common.block.tile;
import net.minecraft.entity.AgeableEntity;
import net.minecraft.entity.AgeableEntity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.MobEntity;
import net.minecraft.entity.SpawnReason;
import net.minecraft.entity.merchant.villager.VillagerEntity;
import net.minecraft.entity.monster.ShulkerEntity;
import net.minecraft.entity.passive.ChickenEntity;
@@ -82,9 +84,9 @@ public class TileCocoon extends TileMod implements ITickableTileEntity{
float shulkerChance = Math.min(1F, (float) chorusFruitGiven / (float) MAX_CHORUS_FRUITS);
if(Math.random() < shulkerChance) {
entity = new ShulkerEntity(world);
entity = EntityType.SHULKER.create(world);
} else if(Math.random() < villagerChance) {
VillagerEntity villager = new VillagerEntity(world);
VillagerEntity villager = EntityType.VILLAGER.create(world);
VillagerRegistry.setRandomProfession(villager, world.rand);
entity = villager;
} else {
@@ -93,40 +95,40 @@ public class TileCocoon extends TileMod implements ITickableTileEntity{
int entityType = world.rand.nextInt(5);
switch(entityType) {
case 0:
entity = new HorseEntity(world);
entity = EntityType.HORSE.create(world);
break;
case 1:
entity = new WolfEntity(world);
entity = EntityType.WOLF.create(world);
break;
case 2:
entity = new OcelotEntity(world);
entity = EntityType.OCELOT.create(world);
break;
case 3:
entity = new ParrotEntity(world);
entity = EntityType.PARROT.create(world);
break;
case 4:
entity = new LlamaEntity(world);
entity = EntityType.LLAMA.create(world);
break;
}
} else {
int entityType = world.rand.nextInt(5);
switch(entityType) {
case 0:
entity = new SheepEntity(world);
entity = EntityType.SHEEP.create(world);
break;
case 1:
if(Math.random() < 0.01)
entity = new MooshroomEntity(world);
else entity = new CowEntity(world);
entity = EntityType.MOOSHROOM.create(world);
else entity = EntityType.COW.create(world);
break;
case 2:
entity = new PigEntity(world);
entity = EntityType.PIG.create(world);
break;
case 3:
entity = new ChickenEntity(world);
entity = EntityType.CHICKEN.create(world);
break;
case 4:
entity = new RabbitEntity(world);
entity = EntityType.RABBIT.create(world);
break;
}
}
@@ -136,7 +138,7 @@ public class TileCocoon extends TileMod implements ITickableTileEntity{
entity.setPosition(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
if(entity instanceof AgeableEntity)
((AgeableEntity) entity).setGrowingAge(-24000);
entity.onInitialSpawn(world.getDifficultyForLocation(getPos()), null, null);
entity.onInitialSpawn(world, world.getDifficultyForLocation(getPos()), SpawnReason.EVENT, null, null);
world.spawnEntity(entity);
entity.spawnExplosionParticle();
}
@@ -14,7 +14,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.MobEntity;
import net.minecraft.entity.ILivingEntityData;
import net.minecraft.entity.MobEntity;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
@@ -13,7 +13,7 @@ package vazkii.botania.common.block.tile.mana;
import net.minecraft.block.FurnaceBlock;
import net.minecraft.block.FurnaceBlock;
import net.minecraft.block.Blocks;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.Direction;
import net.minecraft.util.SoundEvents;
@@ -94,8 +94,8 @@ public class TileBellows extends TileMod implements ITickableTileEntity {
double d5 = enumfacing$axis == Direction.Axis.X ? (double)enumfacing.getXOffset() * 0.52D : d4;
double d6 = world.rand.nextDouble() * 6.0D / 16.0D;
double d7 = enumfacing$axis == Direction.Axis.Z ? (double)enumfacing.getZOffset() * 0.52D : d4;
world.addParticle(Particles.SMOKE, d0 + d5, d1 + d6, d2 + d7, 0.0D, 0.0D, 0.0D);
world.addParticle(Particles.FLAME, d0 + d5, d1 + d6, d2 + d7, 0.0D, 0.0D, 0.0D);
world.addParticle(ParticleTypes.SMOKE, d0 + d5, d1 + d6, d2 + d7, 0.0D, 0.0D, 0.0D);
world.addParticle(ParticleTypes.FLAME, d0 + d5, d1 + d6, d2 + d7, 0.0D, 0.0D, 0.0D);
}
}
@@ -11,7 +11,7 @@
package vazkii.botania.common.block.tile.mana;
import com.google.common.collect.ImmutableMap;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
@@ -94,7 +94,7 @@ public class TilePump extends TileMod implements ITickableTileEntity {
innerRingPos = Math.min(max, innerRingPos);
moving = 0F;
for(int x = 0; x < 2; x++)
world.addParticle(Particles.SMOKE, getPos().getX() + Math.random(), getPos().getY() + Math.random(), getPos().getZ() + Math.random(), 0, 0, 0);
world.addParticle(ParticleTypes.SMOKE, getPos().getX() + Math.random(), getPos().getY() + Math.random(), getPos().getZ() + Math.random(), 0, 0, 0);
}
} else if(innerRingPos > min) {
innerRingPos -= incr * 2;
@@ -38,6 +38,7 @@ import net.minecraft.util.Rotation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceFluidMode;
import net.minecraft.util.math.RayTraceResult;
@@ -205,7 +206,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
for(Direction dir : Direction.values()) {
TileEntity tileAt = world.getTileEntity(pos.offset(dir));
if(world.isBlockLoaded(pos.offset(dir), false) && tileAt instanceof IManaPool) {
if(world.isBlockLoaded(pos.offset(dir)) && tileAt instanceof IManaPool) {
IManaPool pool = (IManaPool) tileAt;
if(wasInNetwork && (pool != receiver || isRedstone())) {
if(pool instanceof IKeyLocked && !((IKeyLocked) pool).getOutputKey().equals(getInputKey()))
@@ -403,12 +404,13 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.ding, SoundCategory.PLAYERS, 0.1F, 1);
} else {
RayTraceResult pos = rayTraceFromEntity(world, player, true);
if(pos != null && pos.hitVec != null && !world.isRemote) {
double x = pos.hitVec.x - getPos().getX() - 0.5;
double y = pos.hitVec.y - getPos().getY() - 0.5;
double z = pos.hitVec.z - getPos().getZ() - 0.5;
if(pos instanceof BlockRayTraceResult && !world.isRemote) {
double x = pos.getHitVec().x - getPos().getX() - 0.5;
double y = pos.getHitVec().y - getPos().getY() - 0.5;
double z = pos.getHitVec().z - getPos().getZ() - 0.5;
if(pos.sideHit != Direction.DOWN && pos.sideHit != Direction.UP) {
BlockRayTraceResult bpos = (BlockRayTraceResult) pos;
if(bpos.getFace() != Direction.DOWN && bpos.getFace() != Direction.UP) {
Vector3 clickVector = new Vector3(x, 0, z);
Vector3 relative = new Vector3(-0.5, 0, 0);
double angle = Math.acos(clickVector.dotProduct(relative) / (relative.mag() * clickVector.mag())) * 180D / Math.PI;
@@ -489,7 +491,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
if(receiver instanceof IManaReceiver
&& receiver.hasWorld()
&& receiver.getWorld().isBlockLoaded(receiver.getPos(), !receiver.getWorld().isRemote))
&& receiver.getWorld().isBlockLoaded(receiver.getPos()))
this.receiver = (IManaReceiver) receiver;
else this.receiver = null;
lastTentativeBurst = fakeBurst.propsList;
@@ -529,7 +531,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
burst.setMinManaLoss(mmForcedTicksBeforeManaLoss);
burst.setManaLossPerTick(mmForcedManaLossPerTick);
burst.setGravity(mmForcedGravity);
burst.setMotion(burst.motionX * mmForcedVelocityMultiplier, burst.motionY * mmForcedVelocityMultiplier, burst.motionZ * mmForcedVelocityMultiplier);
burst.setMotion(burst.getMotion().scale(mmForcedVelocityMultiplier));
} else {
burst.setColor(props.color);
burst.setMana(props.maxMana);
@@ -537,7 +539,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
burst.setMinManaLoss(props.ticksBeforeManaLoss);
burst.setManaLossPerTick(props.manaLossPerTick);
burst.setGravity(props.gravity);
burst.setMotion(burst.motionX * props.motionModifier, burst.motionY * props.motionModifier, burst.motionZ * props.motionModifier);
burst.setMotion(burst.getMotion().scale(props.motionModifier));
}
return burst;
@@ -77,7 +77,7 @@ public final class ConfigHandler {
.comment("Set this to false to disable the particles in the elven portal.")
.define("particles.elf_portal", true);
useVanillaParticleLimiter = builder
.comment("Set this to false to always display all particles regardless of the \"Particles\" setting in the Vanilla options menu.")
.comment("Set this to false to always display all particles regardless of the \"ParticleTypes\" setting in the Vanilla options menu.")
.define("particles.use_vanilla", true);
renderAccessories = builder
.comment("Set this to false to disable rendering of baubles in the player.")
@@ -6,6 +6,7 @@ import com.google.gson.JsonSerializationContext;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.LootContext;
import net.minecraft.world.storage.loot.LootFunction;
import net.minecraft.world.storage.loot.conditions.ILootCondition;
import net.minecraft.world.storage.loot.functions.ILootFunction;
import vazkii.botania.common.item.ModItems;
@@ -15,7 +16,7 @@ import vazkii.botania.common.lib.LibMisc;
import javax.annotation.Nonnull;
import java.util.Random;
public class BindUuid extends ILootFunction {
public class BindUuid extends LootFunction {
protected BindUuid(ILootCondition[] conditionsIn) {
super(conditionsIn);
@@ -23,7 +24,7 @@ public class BindUuid extends ILootFunction {
@Nonnull
@Override
public ItemStack apply(@Nonnull ItemStack stack, @Nonnull Random rand, @Nonnull LootContext context) {
public ItemStack doApply(@Nonnull ItemStack stack, @Nonnull LootContext context) {
if (context.getKillerPlayer() != null) {
((ItemRelic) ModItems.dice).bindToUUID(context.getKillerPlayer().getUniqueID(), stack);
}
@@ -15,11 +15,11 @@ import java.util.Random;
public class EnableRelics implements ILootCondition {
@Override
public boolean testCondition(@Nonnull Random rand, @Nonnull LootContext context) {
public boolean test(@Nonnull LootContext context) {
return ConfigHandler.COMMON.relicsEnabled.get();
}
public static class Serializer extends ILootCondition.Serializer<EnableRelics> {
public static class Serializer extends ILootCondition.AbstractSerializer<EnableRelics> {
public Serializer() {
super(new ResourceLocation(LibMisc.MOD_ID, "enable_relics"), EnableRelics.class);
}
@@ -16,7 +16,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.registries.IForgeRegistryEntry;
@@ -29,14 +29,14 @@ import javax.annotation.Nonnull;
public class AncientWillRecipe extends SpecialRecipe {
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "ancient_will_attach");
public static final IRecipeSerializer<AncientWillRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), AncientWillRecipe::new);
public static final IRecipeSerializer<AncientWillRecipe> SERIALIZER = new SpecialRecipeSerializer<>(AncientWillRecipe::new);
public AncientWillRecipe(ResourceLocation id) {
super(id);
}
@Override
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
public boolean matches(@Nonnull CraftingInventory inv, @Nonnull World world) {
boolean foundWill = false;
boolean foundItem = false;
@@ -58,7 +58,7 @@ public class AncientWillRecipe extends SpecialRecipe {
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
public ItemStack getCraftingResult(@Nonnull CraftingInventory inv) {
ItemStack item = ItemStack.EMPTY;
IAncientWillContainer.AncientWillType will = null;
@@ -17,7 +17,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.registries.IForgeRegistryEntry;
@@ -29,14 +29,14 @@ import javax.annotation.Nonnull;
public class BlackHoleTalismanExtractRecipe extends SpecialRecipe {
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "black_hole_talisman_extract");
public static final IRecipeSerializer<BlackHoleTalismanExtractRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), BlackHoleTalismanExtractRecipe::new);
public static final IRecipeSerializer<BlackHoleTalismanExtractRecipe> SERIALIZER = new SpecialRecipeSerializer<>(BlackHoleTalismanExtractRecipe::new);
public BlackHoleTalismanExtractRecipe(ResourceLocation id) {
super(id);
}
@Override
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
public boolean matches(@Nonnull CraftingInventory inv, @Nonnull World world) {
boolean foundTalisman = false;
for(int i = 0; i < inv.getSizeInventory(); i++) {
@@ -53,7 +53,7 @@ public class BlackHoleTalismanExtractRecipe extends SpecialRecipe {
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
public ItemStack getCraftingResult(@Nonnull CraftingInventory inv) {
ItemStack talisman = ItemStack.EMPTY;
for(int i = 0; i < inv.getSizeInventory(); i++) {
@@ -17,7 +17,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.registries.IForgeRegistryEntry;
@@ -30,14 +30,14 @@ import javax.annotation.Nonnull;
public class CompositeLensRecipe extends SpecialRecipe {
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "composite_lens");
public static final IRecipeSerializer<CompositeLensRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), CompositeLensRecipe::new);
public static final IRecipeSerializer<CompositeLensRecipe> SERIALIZER = new SpecialRecipeSerializer<>(CompositeLensRecipe::new);
public CompositeLensRecipe(ResourceLocation id) {
super(id);
}
@Override
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
public boolean matches(@Nonnull CraftingInventory inv, @Nonnull World world) {
boolean foundLens = false;
boolean foundSecondLens = false;
boolean foundSlimeball = false;
@@ -60,7 +60,7 @@ public class CompositeLensRecipe extends SpecialRecipe {
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
public ItemStack getCraftingResult(@Nonnull CraftingInventory inv) {
ItemStack lens = ItemStack.EMPTY;
ItemStack secondLens = ItemStack.EMPTY;
@@ -16,8 +16,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.registries.IForgeRegistryEntry;
@@ -29,14 +29,14 @@ import javax.annotation.Nonnull;
public class CosmeticAttachRecipe extends SpecialRecipe {
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "cosmetic_attach");
public static final IRecipeSerializer<CosmeticAttachRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), CosmeticAttachRecipe::new);
public static final IRecipeSerializer<CosmeticAttachRecipe> SERIALIZER = new SpecialRecipeSerializer<>(CosmeticAttachRecipe::new);
public CosmeticAttachRecipe(ResourceLocation id) {
super(id);
}
@Override
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
public boolean matches(@Nonnull CraftingInventory inv, @Nonnull World world) {
boolean foundCosmetic = false;
boolean foundAttachable = false;
@@ -58,7 +58,7 @@ public class CosmeticAttachRecipe extends SpecialRecipe {
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
public ItemStack getCraftingResult(@Nonnull CraftingInventory inv) {
ItemStack cosmeticItem = ItemStack.EMPTY;
ItemStack attachableItem = ItemStack.EMPTY;
@@ -16,7 +16,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.registries.IForgeRegistryEntry;
@@ -28,14 +28,14 @@ import javax.annotation.Nonnull;
public class CosmeticRemoveRecipe extends SpecialRecipe {
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "cosmetic_remove");
public static final IRecipeSerializer<CosmeticRemoveRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), CosmeticRemoveRecipe::new);
public static final IRecipeSerializer<CosmeticRemoveRecipe> SERIALIZER = new SpecialRecipeSerializer<>(CosmeticRemoveRecipe::new);
public CosmeticRemoveRecipe(ResourceLocation id) {
super(id);
}
@Override
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
public boolean matches(@Nonnull CraftingInventory inv, @Nonnull World world) {
boolean foundAttachable = false;
for(int i = 0; i < inv.getSizeInventory(); i++) {
@@ -52,7 +52,7 @@ public class CosmeticRemoveRecipe extends SpecialRecipe {
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
public ItemStack getCraftingResult(@Nonnull CraftingInventory inv) {
ItemStack attachableItem = ItemStack.EMPTY;
for(int i = 0; i < inv.getSizeInventory(); i++) {
@@ -16,8 +16,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.registries.IForgeRegistryEntry;
@@ -30,14 +30,14 @@ import javax.annotation.Nonnull;
public class KeepIvyRecipe extends SpecialRecipe {
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "keep_ivy");
public static final IRecipeSerializer<KeepIvyRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), KeepIvyRecipe::new);
public static final IRecipeSerializer<KeepIvyRecipe> SERIALIZER = new SpecialRecipeSerializer<>(KeepIvyRecipe::new);
public KeepIvyRecipe(ResourceLocation id) {
super(id);
}
@Override
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
public boolean matches(@Nonnull CraftingInventory inv, @Nonnull World world) {
boolean foundIvy = false;
boolean foundItem = false;
@@ -59,7 +59,7 @@ public class KeepIvyRecipe extends SpecialRecipe {
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
public ItemStack getCraftingResult(@Nonnull CraftingInventory inv) {
ItemStack item = ItemStack.EMPTY;
for(int i = 0; i < inv.getSizeInventory(); i++) {
@@ -10,12 +10,13 @@
*/
package vazkii.botania.common.crafting.recipe;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.common.Tags;
@@ -30,7 +31,7 @@ import java.util.List;
public class LensDyeingRecipe extends SpecialRecipe {
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "lens_dye");
public static final IRecipeSerializer<LensDyeingRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), LensDyeingRecipe::new);
public static final IRecipeSerializer<LensDyeingRecipe> SERIALIZER = new SpecialRecipeSerializer<>(LensDyeingRecipe::new);
private final List<Ingredient> dyes = Arrays.asList(
Ingredient.fromTag(Tags.Items.DYES_WHITE), Ingredient.fromTag(Tags.Items.DYES_ORANGE),
@@ -55,7 +56,7 @@ public class LensDyeingRecipe extends SpecialRecipe {
}
@Override
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
public boolean matches(@Nonnull CraftingInventory inv, @Nonnull World world) {
boolean foundLens = false;
boolean foundDye = false;
@@ -79,7 +80,7 @@ public class LensDyeingRecipe extends SpecialRecipe {
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
public ItemStack getCraftingResult(@Nonnull CraftingInventory inv) {
ItemStack lens = ItemStack.EMPTY;
int color = -1;
@@ -16,8 +16,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.registries.IForgeRegistryEntry;
@@ -29,14 +29,14 @@ import javax.annotation.Nonnull;
public class ManaGunClipRecipe extends SpecialRecipe {
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "mana_gun_add_clip");
public static final IRecipeSerializer<ManaGunClipRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), ManaGunClipRecipe::new);
public static final IRecipeSerializer<ManaGunClipRecipe> SERIALIZER = new SpecialRecipeSerializer<>(ManaGunClipRecipe::new);
public ManaGunClipRecipe(ResourceLocation id) {
super(id);
}
@Override
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
public boolean matches(@Nonnull CraftingInventory inv, @Nonnull World world) {
boolean foundGun = false;
boolean foundClip = false;
@@ -58,7 +58,7 @@ public class ManaGunClipRecipe extends SpecialRecipe {
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
public ItemStack getCraftingResult(@Nonnull CraftingInventory inv) {
ItemStack gun = ItemStack.EMPTY;
for(int i = 0; i < inv.getSizeInventory(); i++) {
@@ -16,8 +16,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.registries.IForgeRegistryEntry;
@@ -30,14 +30,14 @@ import javax.annotation.Nonnull;
public class ManaGunLensRecipe extends SpecialRecipe {
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "mana_gun_add_lens");
public static final IRecipeSerializer<ManaGunLensRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), ManaGunLensRecipe::new);
public static final IRecipeSerializer<ManaGunLensRecipe> SERIALIZER = new SpecialRecipeSerializer<>(ManaGunLensRecipe::new);
public ManaGunLensRecipe(ResourceLocation id) {
super(id);
}
@Override
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
public boolean matches(@Nonnull CraftingInventory inv, @Nonnull World world) {
boolean foundLens = false;
boolean foundGun = false;
@@ -62,7 +62,7 @@ public class ManaGunLensRecipe extends SpecialRecipe {
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
public ItemStack getCraftingResult(@Nonnull CraftingInventory inv) {
ItemStack lens = ItemStack.EMPTY;
ItemStack gun = ItemStack.EMPTY;
@@ -16,8 +16,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.registries.IForgeRegistryEntry;
@@ -28,14 +28,14 @@ import javax.annotation.Nonnull;
public class ManaGunRemoveLensRecipe extends SpecialRecipe {
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "mana_gun_remove_lens");
public static final IRecipeSerializer<ManaGunRemoveLensRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), ManaGunRemoveLensRecipe::new);
public static final IRecipeSerializer<ManaGunRemoveLensRecipe> SERIALIZER = new SpecialRecipeSerializer<>(ManaGunRemoveLensRecipe::new);
public ManaGunRemoveLensRecipe(ResourceLocation id) {
super(id);
}
@Override
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
public boolean matches(@Nonnull CraftingInventory inv, @Nonnull World world) {
boolean foundGun = false;
for(int i = 0; i < inv.getSizeInventory(); i++) {
@@ -53,7 +53,7 @@ public class ManaGunRemoveLensRecipe extends SpecialRecipe {
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
public ItemStack getCraftingResult(@Nonnull CraftingInventory inv) {
ItemStack gun = ItemStack.EMPTY;
for(int i = 0; i < inv.getSizeInventory(); i++) {
@@ -16,7 +16,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.ShapedRecipe;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.NonNullList;
@@ -16,7 +16,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.registries.IForgeRegistryEntry;
@@ -28,14 +28,14 @@ import javax.annotation.Nonnull;
public class PhantomInkRecipe extends SpecialRecipe {
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "phantom_ink_apply");
public static final IRecipeSerializer<PhantomInkRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), PhantomInkRecipe::new);
public static final IRecipeSerializer<PhantomInkRecipe> SERIALIZER = new SpecialRecipeSerializer<>(PhantomInkRecipe::new);
public PhantomInkRecipe(ResourceLocation id) {
super(id);
}
@Override
public boolean matches(@Nonnull IInventory var1, @Nonnull World var2) {
public boolean matches(@Nonnull CraftingInventory var1, @Nonnull World var2) {
boolean foundInk = false;
boolean foundItem = false;
@@ -57,7 +57,7 @@ public class PhantomInkRecipe extends SpecialRecipe {
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull IInventory var1) {
public ItemStack getCraftingResult(@Nonnull CraftingInventory var1) {
ItemStack item = ItemStack.EMPTY;
for(int i = 0; i < var1.getSizeInventory(); i++) {
@@ -16,8 +16,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.RecipeSerializers;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
@@ -29,14 +29,14 @@ import javax.annotation.Nonnull;
public class SpellClothRecipe extends SpecialRecipe {
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "spell_cloth_apply");
public static final IRecipeSerializer<SpellClothRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), SpellClothRecipe::new);
public static final IRecipeSerializer<SpellClothRecipe> SERIALIZER = new SpecialRecipeSerializer<>(SpellClothRecipe::new);
public SpellClothRecipe(ResourceLocation id) {
super(id);
}
@Override
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
public boolean matches(@Nonnull CraftingInventory inv, @Nonnull World world) {
boolean foundCloth = false;
boolean foundEnchanted = false;
@@ -58,7 +58,7 @@ public class SpellClothRecipe extends SpecialRecipe {
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
public ItemStack getCraftingResult(@Nonnull CraftingInventory inv) {
ItemStack stackToDisenchant = ItemStack.EMPTY;
for(int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
@@ -433,7 +433,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti
}
playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 20F, (1F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F);
world.addParticle(Particles.EXPLOSION_EMITTER, posX, posY, posZ, 1D, 0D, 0D);
world.addParticle(ParticleTypes.EXPLOSION_EMITTER, posX, posY, posZ, 1D, 0D, 0D);
}
@Override
@@ -872,7 +872,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti
double px = oldX + (newX - oldX) * progress + (random.nextDouble() - 0.5D) * width * 2.0D;
double py = oldY + (newY - oldY) * progress + random.nextDouble() * height;
double pz = oldZ + (newZ - oldZ) * progress + (random.nextDouble() - 0.5D) * width * 2.0D;
world.addParticle(Particles.PORTAL, px, py, pz, vx, vy, vz);
world.addParticle(ParticleTypes.PORTAL, px, py, pz, vx, vy, vz);
}
Vec3d oldPosVec = new Vec3d(oldX, oldY + height / 2, oldZ);
@@ -33,7 +33,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.ThrowableEntity;
import net.minecraft.block.Blocks;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundNBT;
@@ -277,7 +277,7 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst {
if (this.isInWater()) {
for(int j = 0; j < 4; ++j) {
float f3 = 0.25F;
this.world.addParticle(Particles.BUBBLE, this.posX - this.motionX * 0.25D, this.posY - this.motionY * 0.25D, this.posZ - this.motionZ * 0.25D, this.motionX, this.motionY, this.motionZ);
this.world.addParticle(ParticleTypes.BUBBLE, this.posX - this.motionX * 0.25D, this.posY - this.motionY * 0.25D, this.posZ - this.motionZ * 0.25D, this.motionX, this.motionY, this.motionZ);
}
f1 = 0.8F;
@@ -20,7 +20,7 @@ import net.minecraft.entity.boss.WitherEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.util.Hand;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
@@ -58,7 +58,7 @@ public class EntityPinkWither extends WitherEntity {
double d10 = getHeadX(j);
double d2 = getHeadY(j);
double d4 = getHeadZ(j);
world.addParticle(Particles.HEART, d10 + rand.nextGaussian() * 0.30000001192092896D, d2 + rand.nextGaussian() * 0.30000001192092896D, d4 + rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D);
world.addParticle(ParticleTypes.HEART, d10 + rand.nextGaussian() * 0.30000001192092896D, d2 + rand.nextGaussian() * 0.30000001192092896D, d4 + rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D);
}
}
@@ -27,7 +27,7 @@ import net.minecraft.entity.projectile.ThrowableEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Effects;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.datasync.DataParameter;
@@ -112,7 +112,7 @@ public class EntityThornChakram extends ThrowableEntity {
double r = 0.1;
double m = 0.1;
for(int i = 0; i < 3; i++)
world.addParticle(Particles.FLAME, posX + r * (Math.random() - 0.5), posY + r * (Math.random() - 0.5), posZ + r * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5));
world.addParticle(ParticleTypes.FLAME, posX + r * (Math.random() - 0.5), posY + r * (Math.random() - 0.5), posZ + r * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5));
}
// Server state control
@@ -10,7 +10,7 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.IProjectile;
import net.minecraft.block.Blocks;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil;
@@ -235,7 +235,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
if (this.isInWater()) {
for(int j = 0; j < 4; ++j) {
float f3 = 0.25F;
this.world.addParticle(Particles.BUBBLE, this.posX - this.motionX * 0.25D, this.posY - this.motionY * 0.25D, this.posZ - this.motionZ * 0.25D, this.motionX, this.motionY, this.motionZ);
this.world.addParticle(ParticleTypes.BUBBLE, this.posX - this.motionX * 0.25D, this.posY - this.motionY * 0.25D, this.posZ - this.motionZ * 0.25D, this.motionX, this.motionY, this.motionZ);
}
f1 = 0.8F;
@@ -19,7 +19,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.projectile.ThrowableEntity;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.ItemStack;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
@@ -70,7 +70,7 @@ public class EntityVineBall extends ThrowableEntity {
public void handleStatusUpdate(byte id) {
if(id == 3) {
for(int j = 0; j < 16; j++) {
world.addParticle(new ItemParticleData(Particles.ITEM, new ItemStack(ModItems.vineBall)), posX, posY, posZ, Math.random() * 0.2 - 0.1, Math.random() * 0.25, Math.random() * 0.2 - 0.1);
world.addParticle(new ItemParticleData(ParticleTypes.ITEM, new ItemStack(ModItems.vineBall)), posX, posY, posZ, Math.random() * 0.2 - 0.1, Math.random() * 0.25, Math.random() * 0.2 - 0.1);
}
}
}
@@ -21,7 +21,7 @@ import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.projectile.ThrowableEntity;
import net.minecraft.entity.projectile.ThrowableEntity;
import net.minecraft.block.Blocks;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
@@ -289,7 +289,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet
ThrowableEntity entity = (ThrowableEntity) burst;
ItemStack lens = burst.getSourceLens();
BlockState state = NBTUtil.readBlockState(lens.getOrCreateTag().getCompound(TAG_STATE));
entity.world.addParticle(new BlockParticleData(Particles.BLOCK, state), entity.posX, entity.posY, entity.posZ, entity.motionX, entity.motionY, entity.motionZ);
entity.world.addParticle(new BlockParticleData(ParticleTypes.BLOCK, state), entity.posX, entity.posY, entity.posZ, entity.motionX, entity.motionY, entity.motionZ);
return true;
}
@@ -18,7 +18,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.Fluids;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.SoundEvents;
@@ -65,7 +65,7 @@ public class ItemOpenBucket extends ItemMod {
// Botania: some particles
for(int x = 0; x < 5; x++)
worldIn.addParticle(Particles.POOF, blockpos.getX() + Math.random(), blockpos.getY() + Math.random(), blockpos.getZ() + Math.random(), 0, 0, 0);
worldIn.addParticle(ParticleTypes.POOF, blockpos.getX() + Math.random(), blockpos.getY() + Math.random(), blockpos.getZ() + Math.random(), 0, 0, 0);
return new ActionResult<>(ActionResultType.SUCCESS, itemstack);
}
@@ -17,7 +17,7 @@ import net.minecraft.entity.item.FallingBlockEntity;
import net.minecraft.entity.item.FallingBlockEntity;
import net.minecraft.entity.projectile.ThrowableEntity;
import net.minecraft.block.Blocks;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.ItemStack;
import net.minecraft.particles.BlockParticleData;
import net.minecraft.util.math.BlockPos;
@@ -43,7 +43,7 @@ public class LensWeight extends Lens {
FallingBlockEntity falling = new FallingBlockEntity(entity.world, bPos.getX() + 0.5, bPos.getY(), bPos.getZ() + 0.5, state);
falling.fallTime = 1;
entity.world.removeBlock(bPos);
((ServerWorld) entity.world).spawnParticle(new BlockParticleData(Particles.FALLING_DUST, state), bPos.getX() + 0.5, bPos.getY() + 0.5, bPos.getZ() + 0.5, 10, 0.45, 0.45, 0.45, 5);
((ServerWorld) entity.world).spawnParticle(new BlockParticleData(ParticleTypes.FALLING_DUST, state), bPos.getX() + 0.5, bPos.getY() + 0.5, bPos.getZ() + 0.5, 10, 0.45, 0.45, 0.45, 5);
entity.world.spawnEntity(falling);
}
}
@@ -3,7 +3,7 @@ package vazkii.botania.common.network;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.init.Particles;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.DyeColor;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
@@ -113,7 +113,7 @@ public class PacketBotaniaEffect {
double d1 = item.world.rand.nextGaussian() * m;
double d2 = item.world.rand.nextGaussian() * m;
double d3 = 10.0D;
item.world.addParticle(Particles.POOF,
item.world.addParticle(ParticleTypes.POOF,
message.x + item.world.rand.nextFloat() * item.width * 2.0F - item.width - d0 * d3, message.y + item.world.rand.nextFloat() * item.height - d1 * d3,
message.z + item.world.rand.nextFloat() * item.width * 2.0F - item.width - d2 * d3, d0, d1, d2);
}