mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 03:15:07 +00:00
1.8.8 tess fixes, potential double plant fix, bunch of reflectoin in spawner claw
This commit is contained in:
1 parent
5d666cd891
commit
a9b060257f
67 files changed
+480
-240
No files matched your search
@@ -96,6 +96,23 @@ public class BotaniaStateProps {
|
||||
// BlockLivingRock
|
||||
public static final PropertyEnum LIVINGROCK_VARIANT = PropertyEnum.create("variant", LivingRockVariant.class);
|
||||
|
||||
// BlockModDoubleFlower
|
||||
public static final PropertyEnum DOUBLEFLOWER_VARIANT_1 = PropertyEnum.create("variant", EnumDyeColor.class, new Predicate<EnumDyeColor>() {
|
||||
@Override
|
||||
public boolean apply(EnumDyeColor input) {
|
||||
// White to gray
|
||||
return input.ordinal() >= 0 && input.ordinal() <= 7;
|
||||
}
|
||||
});
|
||||
|
||||
public static final PropertyEnum DOUBLEFLOWER_VARIANT_2 = PropertyEnum.create("variant", EnumDyeColor.class, new Predicate<EnumDyeColor>() {
|
||||
@Override
|
||||
public boolean apply(EnumDyeColor input) {
|
||||
// Silver to black
|
||||
return input.ordinal() >= 8 && input.ordinal() <= 15;
|
||||
}
|
||||
});
|
||||
|
||||
// BlockOpenCrate
|
||||
public static final PropertyEnum CRATE_VARIANT = PropertyEnum.create("variant", CrateVariant.class);
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ import java.util.Locale;
|
||||
public enum PoolVariant implements IStringSerializable {
|
||||
DEFAULT,
|
||||
CREATIVE,
|
||||
DILUTED;
|
||||
DILUTED,
|
||||
FABULOUS;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
|
||||
@@ -146,29 +146,29 @@ public class LightningHandler {
|
||||
Vector3 endvec = rendersegment.endpoint.point;
|
||||
|
||||
int color = inner ? bolt.colorInner : bolt.colorOuter;
|
||||
tessellator.getWorldRenderer().setColorRGBA_I(color, (int) (mainalpha * rendersegment.light * new Color(color).getAlpha()));
|
||||
tessellator.getWorldRenderer().putColor(color, (int) (mainalpha * rendersegment.light * new Color(color).getAlpha()));
|
||||
|
||||
tessellator.getWorldRenderer().addVertexWithUV(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z, 0.5, 0);
|
||||
tessellator.getWorldRenderer().addVertexWithUV(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z, 0.5, 0);
|
||||
tessellator.getWorldRenderer().addVertexWithUV(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z, 0.5, 1);
|
||||
tessellator.getWorldRenderer().addVertexWithUV(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z, 0.5, 1);
|
||||
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).tex(0.5, 0).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).tex(0.5, 0).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).tex(0.5, 1).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).tex(0.5, 1).endVertex();
|
||||
|
||||
if(rendersegment.next == null) {
|
||||
Vector3 roundend = rendersegment.endpoint.point.copy().add(rendersegment.diff.copy().normalize().multiply(width));
|
||||
|
||||
tessellator.getWorldRenderer().addVertexWithUV(roundend.x - diff2.x, roundend.y - diff2.y, roundend.z - diff2.z, 0, 0);
|
||||
tessellator.getWorldRenderer().addVertexWithUV(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z, 0.5, 0);
|
||||
tessellator.getWorldRenderer().addVertexWithUV(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z, 0.5, 1);
|
||||
tessellator.getWorldRenderer().addVertexWithUV(roundend.x + diff2.x, roundend.y + diff2.y, roundend.z + diff2.z, 0, 1);
|
||||
tessellator.getWorldRenderer().pos(roundend.x - diff2.x, roundend.y - diff2.y, roundend.z - diff2.z).tex(0, 0).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).tex(0.5, 0).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).tex(0.5, 1).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x + diff2.x, roundend.y + diff2.y, roundend.z + diff2.z).tex(0, 1).endVertex();
|
||||
}
|
||||
|
||||
if(rendersegment.prev == null) {
|
||||
Vector3 roundend = rendersegment.startpoint.point.copy().subtract(rendersegment.diff.copy().normalize().multiply(width));
|
||||
|
||||
tessellator.getWorldRenderer().addVertexWithUV(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z, 0.5, 0);
|
||||
tessellator.getWorldRenderer().addVertexWithUV(roundend.x - diff1.x, roundend.y - diff1.y, roundend.z - diff1.z, 0, 0);
|
||||
tessellator.getWorldRenderer().addVertexWithUV(roundend.x + diff1.x, roundend.y + diff1.y, roundend.z + diff1.z, 0, 1);
|
||||
tessellator.getWorldRenderer().addVertexWithUV(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z, 0.5, 1);
|
||||
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).tex(0.5, 0).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x - diff1.x, roundend.y - diff1.y, roundend.z - diff1.z).tex(0, 0).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x + diff1.x, roundend.y + diff1.y, roundend.z + diff1.z).tex(0, 1).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).tex(0.5, 1).endVertex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class RenderTileSkullOverride extends TileEntitySkullRenderer {
|
||||
public static final ModelSkullOverride modelSkull = new ModelSkullOverride();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_, int digProgress) {
|
||||
public void renderTileEntityAt(TileEntitySkull p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_, int digProgress) {
|
||||
if (p_147500_1_ instanceof TileEntitySkull) {
|
||||
TileEntitySkull skull = ((TileEntitySkull) p_147500_1_);
|
||||
render(skull, (float) p_147500_2_, (float) p_147500_4_, (float) p_147500_6_, EnumFacing.getFront(p_147500_1_.getBlockMetadata() & 7) /*todo 1.8*/, skull.getSkullRotation() * 360 / 16.0F, skull.getSkullType(), skull.getPlayerProfile(), digProgress);
|
||||
|
||||
@@ -23,7 +23,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.block.tile.TileCamo;
|
||||
@@ -38,21 +37,6 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
|
||||
super(par2Material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(tile instanceof TileCamo) {
|
||||
TileCamo camo = (TileCamo) tile;
|
||||
Block block = camo.camo;
|
||||
if(block != null && isValidBlock(block))
|
||||
return block.getIcon(side, camo.camoMeta);
|
||||
}
|
||||
|
||||
return getIconFromSideAfterCheck(tile, meta, side);
|
||||
}
|
||||
|
||||
public static boolean isValidBlock(Block block) {
|
||||
return block.isOpaqueCube() || isValidRenderType(block.getRenderType());
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -29,6 +30,7 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.tile.TileLightRelay;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -42,6 +44,22 @@ public class BlockLightLauncher extends BlockMod implements ILexiconable {
|
||||
setStepSound(soundTypeWood);
|
||||
setUnlocalizedName(LibBlockNames.LIGHT_LAUNCHER);
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 0.25F, 1F);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new BlockState(this, BotaniaStateProps.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(BotaniaStateProps.POWERED) ? 8 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,14 +80,13 @@ public class BlockLightLauncher extends BlockMod implements ILexiconable {
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) {
|
||||
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0|| world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
boolean powered = (meta & 8) != 0;
|
||||
boolean powered = state.getValue(BotaniaStateProps.POWERED);
|
||||
|
||||
if(power && !powered) {
|
||||
pickUpEntities(world, x, y, z);
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta | 8, 4);
|
||||
pickUpEntities(world, pos);
|
||||
world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, true), 4);
|
||||
} else if(!power && powered)
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4);
|
||||
world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 4);
|
||||
}
|
||||
|
||||
public void pickUpEntities(World world, BlockPos pos) {
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.block.BlockDoublePlant;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -32,11 +32,11 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
@@ -44,21 +44,58 @@ import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconable {
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
// Lots of copy paste from BlockDoublePlant because we can no longer extend it in 1.8.x
|
||||
public class BlockModDoubleFlower extends BlockBush implements IGrowable, IShearable, ILexiconable {
|
||||
public static final PropertyEnum<BlockDoublePlant.EnumBlockHalf> HALF = BlockDoublePlant.HALF;
|
||||
private static final int COUNT = 8;
|
||||
|
||||
final int offset;
|
||||
|
||||
public BlockModDoubleFlower(boolean second) {
|
||||
super(Material.vine);
|
||||
this.setHardness(0.0F);
|
||||
this.setStepSound(soundTypeGrass);
|
||||
offset = second ? 8 : 0;
|
||||
setUnlocalizedName(LibBlockNames.DOUBLE_FLOWER + (second ? 2 : 1));
|
||||
setHardness(0F);
|
||||
setStepSound(soundTypeGrass);
|
||||
setTickRandomly(false);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
|
||||
if (second) {
|
||||
setDefaultState(blockState.getBaseState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER).withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2, EnumDyeColor.SILVER));
|
||||
} else {
|
||||
setDefaultState(blockState.getBaseState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER).withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, EnumDyeColor.WHITE));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new BlockState(this, offset == 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, HALF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
int meta = ((EnumDyeColor) state.getValue(offset == 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1)).getMetadata();
|
||||
meta -= offset;
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
meta |= 8;
|
||||
}
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
BlockDoublePlant.EnumBlockHalf half = (meta & 8) > 0 ? BlockDoublePlant.EnumBlockHalf.UPPER : BlockDoublePlant.EnumBlockHalf.LOWER;
|
||||
meta &= -9;
|
||||
meta += offset;
|
||||
EnumDyeColor color = EnumDyeColor.byMetadata(meta);
|
||||
return getDefaultState().withProperty(HALF, half).withProperty(offset == 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,30 +106,13 @@ public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconab
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random p_149650_2_, int p_149650_3_) {
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState p_149692_1_) {
|
||||
return p_149692_1_ & 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon func_149888_a(boolean top, int index) {
|
||||
return (ConfigHandler.altFlowerTextures ? top ? doublePlantTopIconsAlt : doublePlantBottomIconsAlt : top ? doublePlantTopIcons : doublePlantBottomIcons)[index & 7];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_149889_c(World p_149889_1_, int p_149889_2_, int p_149889_3_, int p_149889_4_, int p_149889_5_, int p_149889_6_) {
|
||||
p_149889_1_.setBlock(p_149889_2_, p_149889_3_, p_149889_4_, this, p_149889_5_, p_149889_6_);
|
||||
p_149889_1_.setBlock(p_149889_2_, p_149889_3_ + 1, p_149889_4_, this, p_149889_5_ | 8, p_149889_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World p_149689_1_, BlockPos pos, IBlockState state, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
|
||||
p_149689_1_.setBlockState(pos.up(), this, p_149689_6_.getItemDamage() | 8, 2);
|
||||
public int damageDropped(IBlockState state) {
|
||||
return getMetaFromState(state.withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -100,9 +120,19 @@ public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconab
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void grow(World world, Random rand, BlockPos pos, IBlockState state) {
|
||||
// todo 1.8.8 drop
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, BlockPos pos, IBlockState state, TileEntity te) {
|
||||
if(p_149636_1_.isRemote || p_149636_2_.getCurrentEquippedItem() == null || p_149636_2_.getCurrentEquippedItem().getItem() != Items.shears || func_149887_c(p_149636_6_))
|
||||
if(p_149636_1_.isRemote || p_149636_2_.getCurrentEquippedItem() == null || p_149636_2_.getCurrentEquippedItem().getItem() != Items.shears || state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
harvestBlockCopy(p_149636_1_, p_149636_2_, pos, state);
|
||||
}
|
||||
|
||||
@@ -137,27 +167,31 @@ public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconab
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World p_149681_1_, BlockPos pos, IBlockState state, EntityPlayer p_149681_6_) {
|
||||
if(func_149887_c(p_149681_5_)) {
|
||||
if(p_149681_1_.getBlockState(pos.down()).getBlock() == this) {
|
||||
if(!p_149681_6_.capabilities.isCreativeMode) {
|
||||
int i1 = p_149681_1_.getBlockMetadata(p_149681_2_, p_149681_3_ - 1, p_149681_4_);
|
||||
int j1 = func_149890_d(i1);
|
||||
public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player) {
|
||||
if(state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
if(world.getBlockState(pos.down()).getBlock() == this) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
// IBlockState iblockstate = worldIn.getBlockState(pos.down());
|
||||
// BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType) iblockstate.getValue(VARIANT);
|
||||
|
||||
if(j1 != 3 && j1 != 2);
|
||||
//p_149681_1_.func_147480_a(p_149681_2_, p_149681_3_ - 1, p_149681_4_, true);
|
||||
else {
|
||||
/*if (!p_149681_1_.isRemote && p_149681_6_.getCurrentEquippedItem() != null && p_149681_6_.getCurrentEquippedItem().getItem() == Items.shears)
|
||||
{
|
||||
this.func_149886_b(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, i1, p_149681_6_);
|
||||
}*/
|
||||
|
||||
p_149681_1_.setBlockToAir(pos.down());
|
||||
}
|
||||
} else p_149681_1_.setBlockToAir(pos.down());
|
||||
//if (blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS) {
|
||||
// worldIn.destroyBlock(pos.down(), true);
|
||||
//} else if (!world.isRemote) {
|
||||
// if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) {
|
||||
// this.onHarvest(worldIn, pos, iblockstate, player);
|
||||
// world.setBlockToAir(pos.down());
|
||||
// } else {
|
||||
// world.destroyBlock(pos.down(), true);
|
||||
// }
|
||||
//} else {
|
||||
world.setBlockToAir(pos.down());
|
||||
//}
|
||||
} else {
|
||||
world.setBlockToAir(pos.down());
|
||||
}
|
||||
}
|
||||
} else if(p_149681_6_.capabilities.isCreativeMode && p_149681_1_.getBlockState(pos.up()).getBlock() == this)
|
||||
p_149681_1_.setBlockState(pos.up(), Blocks.air.getDefaultState(), 2);
|
||||
} else if(player.capabilities.isCreativeMode && world.getBlockState(pos.up()).getBlock() == this)
|
||||
world.setBlockState(pos.up(), Blocks.air.getDefaultState(), 2);
|
||||
|
||||
//super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_);
|
||||
}
|
||||
@@ -170,7 +204,7 @@ public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconab
|
||||
@Override
|
||||
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 7));
|
||||
ret.add(new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos).withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER))));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -212,8 +246,93 @@ public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconab
|
||||
return LexiconData.flowers;
|
||||
}
|
||||
|
||||
int offset(int meta) {
|
||||
return meta + offset;
|
||||
|
||||
|
||||
/** BEGIN COPY BlockDoublePlant **/
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
{
|
||||
return super.canPlaceBlockAt(worldIn, pos) && worldIn.isAirBlock(pos.up());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkAndDropBlock(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
if (!this.canBlockStay(worldIn, pos, state))
|
||||
{
|
||||
boolean flag = state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER;
|
||||
BlockPos blockpos = flag ? pos : pos.up();
|
||||
BlockPos blockpos1 = flag ? pos.down() : pos;
|
||||
Block block = (Block)(flag ? this : worldIn.getBlockState(blockpos).getBlock());
|
||||
Block block1 = (Block)(flag ? worldIn.getBlockState(blockpos1).getBlock() : this);
|
||||
|
||||
if (!flag) this.dropBlockAsItem(worldIn, pos, state, 0); //Forge move above the setting to air.
|
||||
|
||||
if (block == this)
|
||||
{
|
||||
worldIn.setBlockState(blockpos, Blocks.air.getDefaultState(), 2);
|
||||
}
|
||||
|
||||
if (block1 == this)
|
||||
{
|
||||
worldIn.setBlockState(blockpos1, Blocks.air.getDefaultState(), 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
if (state.getBlock() != this) return super.canBlockStay(worldIn, pos, state); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER)
|
||||
{
|
||||
return worldIn.getBlockState(pos.down()).getBlock() == this;
|
||||
}
|
||||
else
|
||||
{
|
||||
IBlockState iblockstate = worldIn.getBlockState(pos.up());
|
||||
return iblockstate.getBlock() == this && super.canBlockStay(worldIn, pos, iblockstate);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
|
||||
{
|
||||
worldIn.setBlockState(pos.up(), this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.UPPER), 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER)
|
||||
{
|
||||
IBlockState iblockstate = worldIn.getBlockState(pos.down());
|
||||
|
||||
if (iblockstate.getBlock() == this)
|
||||
{
|
||||
state = state.withProperty(BotaniaStateProps.COLOR, iblockstate.getValue(BotaniaStateProps.COLOR));
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
//Forge: Break both parts on the client to prevent the top part flickering as default type for a few frames.
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
if (state.getBlock() == this && state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.LOWER && world.getBlockState(pos.up()).getBlock() == this)
|
||||
world.setBlockToAir(pos.up());
|
||||
return world.setBlockToAir(pos);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -153,9 +153,8 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup
|
||||
|
||||
public static void placeDoubleFlower(World world, BlockPos pos, EnumDyeColor color, int flags) {
|
||||
Block flower = color.getMetadata() >= 8 ? ModBlocks.doubleFlower2 : ModBlocks.doubleFlower1;
|
||||
int placeMeta = meta & 7;
|
||||
world.setBlockState(pos, flower.getDefaultState().withProperty(BotaniaStateProps.COLOR, color).withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.LOWER), flags);
|
||||
world.setBlockState(pos.up(), flower.getDefaultState().withProperty(BotaniaStateProps.COLOR, color).withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.UPPER), flags);
|
||||
world.setBlockState(pos, flower.getDefaultState().withProperty(color.getMetadata() >= 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color).withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.LOWER), flags);
|
||||
world.setBlockState(pos.up(), flower.getDefaultState().withProperty(color.getMetadata() >= 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color).withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.UPPER), flags);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -157,7 +157,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isProvidingStrongPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
|
||||
public int getStrongPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
|
||||
return getWeakPower(world, pos, state, side);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
@@ -43,20 +44,20 @@ public class BlockManaGlass extends BlockMod implements ILexiconable {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered1(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
|
||||
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
|
||||
public boolean shouldSideBeRendered1(IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
|
||||
return block == this ? false : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
|
||||
return block == this ? false : super.shouldSideBeRendered(world, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, BlockPos pos, EnumFacing side) {
|
||||
return shouldSideBeRendered1(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, 1 - p_149646_5_); // todo 1.8 wtf
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
return shouldSideBeRendered1(world, pos, side.getOpposite()); // todo 1.8 recheck (was 1 - sideInt)
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
||||
@@ -34,9 +34,6 @@ import net.minecraftforge.fml.common.Optional;
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
public class BlockShinyFlower extends BlockModFlower implements IInfusionStabiliser, IHornHarvestable {
|
||||
|
||||
private static IIcon[] icons;
|
||||
private static IIcon[] iconsAlt;
|
||||
|
||||
public BlockShinyFlower() {
|
||||
super(LibBlockNames.SHINY_FLOWER);
|
||||
setLightLevel(1F);
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockSpecialQuartzStairs extends BlockModStairs {
|
||||
|
||||
public BlockSpecialQuartzStairs(Block source) {
|
||||
super(source, 0, "quartzStairs" + ((BlockSpecialQuartz) source).type);
|
||||
super(source.getDefaultState(), "quartzStairs" + ((BlockSpecialQuartz) source).type);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,13 +15,15 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.FutureStoneVariant;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class Block18StoneStairs extends BlockLivingStairs {
|
||||
|
||||
public Block18StoneStairs(int meta) {
|
||||
super(ModFluffBlocks.stone, meta);
|
||||
public Block18StoneStairs(FutureStoneVariant variant) {
|
||||
super(ModFluffBlocks.stone.getDefaultState().withProperty(BotaniaStateProps.FUTURESTONE_VARIANT, variant));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockEndStoneStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockEndStoneStairs() {
|
||||
super(ModBlocks.endStoneBrick, 0);
|
||||
super(ModBlocks.endStoneBrick.getDefaultState());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,13 +15,15 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.EndBrickVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class BlockEnderBrickStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockEnderBrickStairs() {
|
||||
super(ModBlocks.endStoneBrick, 2);
|
||||
super(ModBlocks.endStoneBrick.getDefaultState().withProperty(BotaniaStateProps.ENDBRICK_VARIANT, EndBrickVariant.ENDER_BRICKS));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package vazkii.botania.common.block.decor.stairs;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
public class BlockLivingStairs extends BlockModStairs {
|
||||
|
||||
public BlockLivingStairs(Block source, int meta) {
|
||||
super(source, meta, source.getUnlocalizedName().replaceAll("tile.", "") + meta + "Stairs");
|
||||
public BlockLivingStairs(IBlockState state) {
|
||||
super(state, state.getBlock().getUnlocalizedName().replaceAll("tile.", "") + state.getBlock().getMetaFromState(state) + "Stairs");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package vazkii.botania.common.block.decor.stairs;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
@@ -15,17 +16,17 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockModStairs extends BlockStairs implements ILexiconable {
|
||||
|
||||
public BlockModStairs(Block source, int meta, String name) {
|
||||
super(source, meta);
|
||||
setBlockName(name);
|
||||
public BlockModStairs(IBlockState state, String name) {
|
||||
super(state);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setBlockName(String par1Str) {
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,17 +11,19 @@
|
||||
package vazkii.botania.common.block.decor.stairs;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class BlockPavementStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockPavementStairs(int meta) {
|
||||
super(ModFluffBlocks.pavement, meta);
|
||||
public BlockPavementStairs(EnumDyeColor color) {
|
||||
super(ModFluffBlocks.pavement.getDefaultState().withProperty(BotaniaStateProps.COLOR, color));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockReedStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockReedStairs() {
|
||||
super(ModBlocks.reedBlock, 0);
|
||||
super(ModBlocks.reedBlock.getDefaultState());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockThatchStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockThatchStairs() {
|
||||
super(ModBlocks.thatch, 0);
|
||||
super(ModBlocks.thatch.getDefaultState());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-3
@@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.CustomBrickVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -12,11 +14,11 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockCustomBrickStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockCustomBrickStairs() {
|
||||
this(0);
|
||||
this(CustomBrickVariant.HELLISH_BRICK);
|
||||
}
|
||||
|
||||
public BlockCustomBrickStairs(int meta) {
|
||||
super(ModBlocks.customBrick, meta);
|
||||
public BlockCustomBrickStairs(CustomBrickVariant variant) {
|
||||
super(ModBlocks.customBrick.getDefaultState().withProperty(BotaniaStateProps.CUSTOMBRICK_VARIANT, variant));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-1
@@ -10,10 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.stairs.bricks;
|
||||
|
||||
import vazkii.botania.api.state.enums.CustomBrickVariant;
|
||||
|
||||
public class BlockSnowBrickStairs extends BlockCustomBrickStairs {
|
||||
|
||||
public BlockSnowBrickStairs() {
|
||||
super(2);
|
||||
super(CustomBrickVariant.FROSTY_BRICK);
|
||||
}
|
||||
|
||||
}
|
||||
+3
-1
@@ -10,10 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.stairs.bricks;
|
||||
|
||||
import vazkii.botania.api.state.enums.CustomBrickVariant;
|
||||
|
||||
public class BlockSoulBrickStairs extends BlockCustomBrickStairs {
|
||||
|
||||
public BlockSoulBrickStairs() {
|
||||
super(1);
|
||||
super(CustomBrickVariant.SOUL_BRICK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,10 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.stairs.bricks;
|
||||
|
||||
import vazkii.botania.api.state.enums.CustomBrickVariant;
|
||||
|
||||
public class BlockTileStairs extends BlockCustomBrickStairs {
|
||||
|
||||
public BlockTileStairs() {
|
||||
super(3);
|
||||
super(CustomBrickVariant.ROOF_TILE);
|
||||
}
|
||||
|
||||
}
|
||||
+3
-1
@@ -1,12 +1,14 @@
|
||||
package vazkii.botania.common.block.decor.stairs.living;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.LivingWoodVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
|
||||
public class BlockDreamwoodPlankStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockDreamwoodPlankStairs() {
|
||||
super(ModBlocks.dreamwood, 1);
|
||||
super(ModBlocks.dreamwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS));
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -6,7 +6,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
public class BlockDreamwoodStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockDreamwoodStairs() {
|
||||
super(ModBlocks.dreamwood, 0);
|
||||
super(ModBlocks.dreamwood.getDefaultState());
|
||||
}
|
||||
|
||||
}
|
||||
+3
-1
@@ -1,12 +1,14 @@
|
||||
package vazkii.botania.common.block.decor.stairs.living;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.LivingRockVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
|
||||
public class BlockLivingrockBrickStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockLivingrockBrickStairs() {
|
||||
super(ModBlocks.livingrock, 1);
|
||||
super(ModBlocks.livingrock.getDefaultState().withProperty(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.BRICK));
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -6,7 +6,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
public class BlockLivingrockStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockLivingrockStairs() {
|
||||
super(ModBlocks.livingrock, 0);
|
||||
super(ModBlocks.livingrock.getDefaultState());
|
||||
}
|
||||
|
||||
}
|
||||
+3
-1
@@ -1,12 +1,14 @@
|
||||
package vazkii.botania.common.block.decor.stairs.living;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.LivingWoodVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
|
||||
public class BlockLivingwoodPlankStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockLivingwoodPlankStairs() {
|
||||
super(ModBlocks.livingwood, 1);
|
||||
super(ModBlocks.livingwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS));
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -6,7 +6,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
public class BlockLivingwoodStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockLivingwoodStairs() {
|
||||
super(ModBlocks.livingwood, 0);
|
||||
super(ModBlocks.livingwood.getDefaultState());
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -16,7 +16,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
public class BlockShimmerrockStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockShimmerrockStairs() {
|
||||
super(ModBlocks.shimmerrock, 0);
|
||||
super(ModBlocks.shimmerrock.getDefaultState());
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -16,7 +16,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
public class BlockShimmerwoodPlankStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockShimmerwoodPlankStairs() {
|
||||
super(ModBlocks.shimmerwoodPlanks, 0);
|
||||
super(ModBlocks.shimmerwoodPlanks.getDefaultState());
|
||||
}
|
||||
|
||||
}
|
||||
+3
-1
@@ -1,10 +1,12 @@
|
||||
package vazkii.botania.common.block.decor.stairs.prismarine;
|
||||
|
||||
|
||||
import vazkii.botania.api.state.enums.PrismarineVariant;
|
||||
|
||||
public class BlockDarkPrismarineStairs extends BlockPrismarineStairs {
|
||||
|
||||
public BlockDarkPrismarineStairs() {
|
||||
super(2);
|
||||
super(PrismarineVariant.DARK_PRIMSARINE);
|
||||
}
|
||||
|
||||
}
|
||||
+3
-1
@@ -1,10 +1,12 @@
|
||||
package vazkii.botania.common.block.decor.stairs.prismarine;
|
||||
|
||||
|
||||
import vazkii.botania.api.state.enums.PrismarineVariant;
|
||||
|
||||
public class BlockPrismarineBrickStairs extends BlockPrismarineStairs {
|
||||
|
||||
public BlockPrismarineBrickStairs() {
|
||||
super(1);
|
||||
super(PrismarineVariant.PRISMARINE_BRICKS);
|
||||
}
|
||||
|
||||
}
|
||||
+5
-3
@@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.PrismarineVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -12,11 +14,11 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockPrismarineStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockPrismarineStairs() {
|
||||
this(0);
|
||||
this(PrismarineVariant.PRISMARINE);
|
||||
}
|
||||
|
||||
public BlockPrismarineStairs(int meta) {
|
||||
super(ModBlocks.prismarine, meta);
|
||||
public BlockPrismarineStairs(PrismarineVariant variant) {
|
||||
super(ModBlocks.prismarine.getDefaultState().withProperty(BotaniaStateProps.PRISMARINE_VARIANT, variant));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.decor.walls;
|
||||
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -33,6 +34,7 @@ public class Block18StoneWall extends BlockModWall {
|
||||
super(ModFluffBlocks.stone, 4);
|
||||
setHardness(1.5F);
|
||||
setResistance(10F);
|
||||
setDefaultState(getDefaultState().withProperty(BotaniaStateProps.FUTURESTONEWALL_VARIANT, FutureStoneVariant.ANDESITE));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,12 +43,16 @@ public class Block18StoneWall extends BlockModWall {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void specifyDefaultState() {
|
||||
setDefaultState(blockState.getBaseState()
|
||||
.withProperty(UP, false).withProperty(NORTH, false).withProperty(SOUTH, false)
|
||||
.withProperty(WEST, false).withProperty(EAST, false)
|
||||
.withProperty(BotaniaStateProps.FUTURESTONEWALL_VARIANT, FutureStoneVariant.ANDESITE)
|
||||
);
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((Enum) state.getValue(BotaniaStateProps.FUTURESTONEWALL_VARIANT)).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
if (meta < 0 || meta > 3) {
|
||||
meta = 0;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.FUTURESTONEWALL_VARIANT, FutureStoneVariant.values()[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.decor.walls;
|
||||
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -20,6 +21,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.BiomeStoneVariant;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -32,16 +34,25 @@ public class BlockBiomeStoneWall extends BlockModWall {
|
||||
super(ModFluffBlocks.biomeStoneA, 8);
|
||||
setHardness(1.5F);
|
||||
setResistance(10F);
|
||||
setDefaultState(getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, BiomeStoneVariant.FOREST));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new BlockState(this, BotaniaStateProps.BIOME);
|
||||
return new BlockState(this, UP, NORTH, SOUTH, WEST, EAST, BotaniaStateProps.BIOMESTONE_VARIANT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void specifyDefaultState() {
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((Enum) state.getValue(BotaniaStateProps.BIOMESTONE_VARIANT)).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
if (meta < 0 || meta >= BiomeStoneVariant.values().length) {
|
||||
meta = 0;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, BiomeStoneVariant.values()[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,13 @@ public abstract class BlockModWall extends BlockWall implements ILexiconable {
|
||||
super(block);
|
||||
this.block = block;
|
||||
setUnlocalizedName(block.getUnlocalizedName().replaceAll("tile.", "") + meta + "Wall");
|
||||
specifyDefaultState();
|
||||
setDefaultState(blockState.getBaseState()
|
||||
.withProperty(UP, false)
|
||||
.withProperty(NORTH, false)
|
||||
.withProperty(SOUTH, false)
|
||||
.withProperty(WEST, false)
|
||||
.withProperty(EAST, false)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,13 +51,6 @@ public abstract class BlockModWall extends BlockWall implements ILexiconable {
|
||||
return new BlockState(this, UP, NORTH, SOUTH, WEST, EAST);
|
||||
}
|
||||
|
||||
protected void specifyDefaultState() {
|
||||
setDefaultState(blockState.getBaseState()
|
||||
.withProperty(UP, false).withProperty(NORTH, false).withProperty(SOUTH, false)
|
||||
.withProperty(WEST, false).withProperty(EAST, false)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceTorchOnTop(IBlockAccess world, BlockPos pos) {
|
||||
return true;
|
||||
|
||||
@@ -223,7 +223,7 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable,
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
return world.getBlockMetadata(x, y, z) == 3 ? LexiconData.rainbowRod : LexiconData.pool;
|
||||
return world.getBlockState(pos).getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.FABULOUS ? LexiconData.rainbowRod : LexiconData.pool;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-2
@@ -13,6 +13,8 @@ package vazkii.botania.common.block.subtile.functional;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
@@ -37,9 +39,9 @@ public class SubTileHeiseiDream extends SubTileFunctional {
|
||||
|
||||
final int cost = 100;
|
||||
|
||||
List<IMob> mobs = supertile.getWorld().getEntitiesWithinAABB(IMob.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
|
||||
List mobs = supertile.getWorld().getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)), Predicates.instanceOf(IMob.class));
|
||||
if(mobs.size() > 1 && mana >= cost)
|
||||
for(IMob mob : mobs) {
|
||||
for(IMob mob : ((List<IMob>) mobs)) {
|
||||
if(mob instanceof EntityLiving) {
|
||||
EntityLiving entity = (EntityLiving) mob;
|
||||
if(brainwashEntity(entity, mobs)) {
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -401,9 +402,9 @@ public class TileEnchanter extends TileMod implements ISparkAttachable, ITickabl
|
||||
|
||||
@Override
|
||||
public ISparkEntity getAttachedSpark() {
|
||||
List<ISparkEntity> sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, new AxisAlignedBB(pos.getX(), pos.getY() + 1, pos.getZ(), pos.getX() + 1, pos.getY() + 2, pos.getZ() + 1));
|
||||
List<Entity> sparks = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.getX(), pos.getY() + 1, pos.getZ(), pos.getX() + 1, pos.getY() + 2, pos.getZ() + 1), Predicates.instanceOf(ISparkEntity.class));
|
||||
if(sparks.size() == 1) {
|
||||
Entity e = (Entity) sparks.get(0);
|
||||
Entity e = sparks.get(0);
|
||||
return (ISparkEntity) e;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,10 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.sql.Ref;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -36,6 +38,11 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver, ITickable
|
||||
int mana = 0;
|
||||
|
||||
private static final Method isActivated = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.IS_ACTIVATED);
|
||||
private static final Field spawnDelay = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.SPAWN_DELAY);
|
||||
private static final Field mobRotation = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.MOB_ROTATION);
|
||||
private static final Field prevMobRotation = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.PREV_MOB_ROTATION);
|
||||
private static final Method spawnNewEntity = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.SPAWN_NEW_ENTITY);
|
||||
private static final Method getEntityNameToSpawn = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.GET_ENTITY_TO_SPAWN);
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
@@ -50,19 +57,21 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver, ITickable
|
||||
mana -= 6;
|
||||
|
||||
if(logic.getSpawnerWorld().isRemote) {
|
||||
if(logic.spawnDelay > 0)
|
||||
--logic.spawnDelay;
|
||||
int delay = spawnDelay.getInt(logic);
|
||||
if(delay > 0)
|
||||
spawnDelay.setInt(logic, delay - 1);
|
||||
|
||||
if(Math.random() > 0.5)
|
||||
Botania.proxy.wispFX(worldObj, getPos().getX() + 0.3 + Math.random() * 0.5, getPos().getY() - 0.3 + Math.random() * 0.25, getPos().getZ() + Math.random(), 0.6F - (float) Math.random() * 0.3F, 0.1F, 0.6F - (float) Math.random() * 0.3F, (float) Math.random() / 3F, -0.025F - 0.005F * (float) Math.random(), 2F);
|
||||
|
||||
logic.prevMobRotation = logic.getMobRotation();
|
||||
logic.mobRotation = (logic.getMobRotation() + 1000.0F / (logic.spawnDelay + 200.0F)) % 360.0D;
|
||||
} else if(logic.spawnDelay == -1)
|
||||
prevMobRotation.set(logic, logic.getMobRotation());
|
||||
mobRotation.set(logic, (logic.getMobRotation() + 1000.0F / (spawnDelay.getInt(logic) + 200.0F)) % 360.0D);
|
||||
} else if(spawnDelay.getInt(logic) == -1)
|
||||
resetTimer(logic);
|
||||
|
||||
if(logic.spawnDelay > 0) {
|
||||
--logic.spawnDelay;
|
||||
int delay = spawnDelay.getInt(logic);
|
||||
if(delay > 0) {
|
||||
spawnDelay.setInt(logic, delay - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -73,28 +82,28 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver, ITickable
|
||||
int maxNearbyEntities = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MAX_NEARBY_ENTITIES);
|
||||
|
||||
for(int i = 0; i < spawnCount; ++i) {
|
||||
Entity entity = EntityList.createEntityByName(logic.getEntityNameToSpawn(), logic.getSpawnerWorld());
|
||||
Entity entity = EntityList.createEntityByName(((String) getEntityNameToSpawn.invoke(logic)), logic.getSpawnerWorld());
|
||||
|
||||
if (entity == null)
|
||||
return;
|
||||
|
||||
int j = logic.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), new AxisAlignedBB(logic.func_177221_b(), logic.func_177221_b().add(1, 1, 1)).expand(spawnRange * 2, 4.0D, spawnRange * 2)).size();
|
||||
int j = logic.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), new AxisAlignedBB(logic.getSpawnerPosition(), logic.getSpawnerPosition().add(1, 1, 1)).expand(spawnRange * 2, 4.0D, spawnRange * 2)).size();
|
||||
|
||||
if (j >= maxNearbyEntities) {
|
||||
resetTimer(logic);
|
||||
return;
|
||||
}
|
||||
|
||||
double d2 = logic.func_177221_b().getX() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
|
||||
double d3 = logic.func_177221_b().getY() + logic.getSpawnerWorld().rand.nextInt(3) - 1;
|
||||
double d4 = logic.func_177221_b().getZ() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
|
||||
double d2 = logic.getSpawnerPosition().getX() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
|
||||
double d3 = logic.getSpawnerPosition().getY() + logic.getSpawnerWorld().rand.nextInt(3) - 1;
|
||||
double d4 = logic.getSpawnerPosition().getZ() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
|
||||
EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null;
|
||||
entity.setLocationAndAngles(d2, d3, d4, logic.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F);
|
||||
|
||||
if(entityliving == null || entityliving.getCanSpawnHere()) {
|
||||
if(!worldObj.isRemote)
|
||||
logic.func_98265_a(entity);
|
||||
logic.getSpawnerWorld().playAuxSFX(2004, logic.func_177221_b(), 0);
|
||||
spawnNewEntity.invoke(logic, entity, true);
|
||||
logic.getSpawnerWorld().playAuxSFX(2004, logic.getSpawnerPosition(), 0);
|
||||
|
||||
if (entityliving != null)
|
||||
entityliving.spawnExplosionParticle();
|
||||
@@ -107,23 +116,23 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver, ITickable
|
||||
resetTimer(logic);
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
Botania.instance.handleIMC();
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void resetTimer(MobSpawnerBaseLogic logic) {
|
||||
private void resetTimer(MobSpawnerBaseLogic logic) throws IllegalAccessException {
|
||||
int maxSpawnDelay = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MAX_SPAWN_DELAY);
|
||||
int minSpawnDelay = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MIN_SPAWN_DELAY);
|
||||
List potentialEntitySpawns = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.POTENTIAL_ENTITY_SPAWNS);
|
||||
|
||||
if(maxSpawnDelay <= minSpawnDelay)
|
||||
logic.spawnDelay = minSpawnDelay;
|
||||
spawnDelay.set(logic, minSpawnDelay);
|
||||
else {
|
||||
int i = maxSpawnDelay - minSpawnDelay;
|
||||
logic.spawnDelay = minSpawnDelay + logic.getSpawnerWorld().rand.nextInt(i);
|
||||
spawnDelay.set(logic, minSpawnDelay + logic.getSpawnerWorld().rand.nextInt(i));
|
||||
}
|
||||
|
||||
if(potentialEntitySpawns != null && potentialEntitySpawns.size() > 0)
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block.tile.mana;
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
@@ -406,7 +407,7 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
|
||||
|
||||
@Override
|
||||
public ISparkEntity getAttachedSpark() {
|
||||
List<ISparkEntity> sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, new AxisAlignedBB(pos.up(), pos.up().add(1, 1, 1)));
|
||||
List sparks = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.up(), pos.up().add(1, 1, 1)), Predicates.instanceOf(ISparkEntity.class));
|
||||
if(sparks.size() == 1) {
|
||||
Entity e = (Entity) sparks.get(0);
|
||||
return (ISparkEntity) e;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.tile.mana;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
@@ -53,7 +54,7 @@ public class TilePump extends TileMod implements ITickable {
|
||||
innerRingPos = Math.min(max, innerRingPos);
|
||||
moving = 0F;
|
||||
for(int x = 0; x < 2; x++)
|
||||
worldObj.spawnParticle("explode", xCoord + Math.random(), yCoord + Math.random(), zCoord + Math.random(), 0, 0, 0);
|
||||
worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, getPos().getX() + Math.random(), getPos().getY() + Math.random(), getPos().getZ() + Math.random(), 0, 0, 0);
|
||||
}
|
||||
} else if(innerRingPos > min) {
|
||||
innerRingPos -= incr * 2;
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block.tile.mana;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
@@ -205,10 +206,10 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
double y = lastPingbackY;
|
||||
double z = lastPingbackZ;
|
||||
AxisAlignedBB aabb = new AxisAlignedBB(x, y, z, x, y, z).expand(PINGBACK_EXPIRED_SEARCH_DISTANCE, PINGBACK_EXPIRED_SEARCH_DISTANCE, PINGBACK_EXPIRED_SEARCH_DISTANCE);
|
||||
List<IManaBurst> bursts = worldObj.getEntitiesWithinAABB(IManaBurst.class, aabb);
|
||||
List bursts = worldObj.getEntitiesWithinAABB(Entity.class, aabb, Predicates.instanceOf(IManaBurst.class));
|
||||
IManaBurst found = null;
|
||||
UUID identity = getIdentifier();
|
||||
for(IManaBurst burst : bursts)
|
||||
for(IManaBurst burst : ((List<IManaBurst>) bursts))
|
||||
if(burst != null && identity.equals(burst.getShooterUIID())) {
|
||||
found = burst;
|
||||
break;
|
||||
|
||||
@@ -44,8 +44,8 @@ public final class AliasHandler {
|
||||
}
|
||||
|
||||
private static Item getItem(String name) {
|
||||
for(Object o : Item.itemRegistry.getKeys()) {
|
||||
Item i = Item.itemRegistry.getObject(new ResourceLocation(o));
|
||||
for(ResourceLocation o : Item.itemRegistry.getKeys()) {
|
||||
Item i = Item.itemRegistry.getObject(o);
|
||||
if(i.getUnlocalizedName().substring("item.".length()).equals(name))
|
||||
return i;
|
||||
}
|
||||
@@ -54,8 +54,8 @@ public final class AliasHandler {
|
||||
}
|
||||
|
||||
private static Block getBlock(String name) {
|
||||
for(Object o : Block.blockRegistry.getKeys()) {
|
||||
Block b = Block.blockRegistry.getObject(new ResourceLocation(o));
|
||||
for(ResourceLocation o : Block.blockRegistry.getKeys()) {
|
||||
Block b = Block.blockRegistry.getObject(o);
|
||||
if(b.getUnlocalizedName().substring("tile.".length()).equals(name))
|
||||
return b;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
@@ -124,7 +125,7 @@ public final class SheddingHandler {
|
||||
lexiconSize = config.get("Shedding", key + ".lexiconDisplaySize", lexiconSize).getInt();
|
||||
|
||||
if(itemName != null && !itemName.isEmpty() && rate != -1)
|
||||
patterns.add(new ShedPattern(EntityList.stringToClassMapping.get(key), new ItemStack(Item.itemRegistry.getObject(itemName), 1, metadata), rate, lexiconSize));
|
||||
patterns.add(new ShedPattern(EntityList.stringToClassMapping.get(key), new ItemStack(Item.itemRegistry.getObject(new ResourceLocation(itemName)), 1, metadata), rate, lexiconSize));
|
||||
}
|
||||
|
||||
public static class ShedPattern {
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.recipe.RecipeBrew;
|
||||
import vazkii.botania.common.brew.ModBrews;
|
||||
@@ -70,8 +71,8 @@ public class ModBrewRecipes {
|
||||
}
|
||||
|
||||
public static void initTC() {
|
||||
Item resource = Item.itemRegistry.getObject("Thaumcraft:ItemResource");
|
||||
Item bathSalts = Item.itemRegistry.getObject("Thaumcraft:ItemBathSalts");
|
||||
Item resource = Item.itemRegistry.getObject(new ResourceLocation("Thaumcraft", "ItemResource"));
|
||||
Item bathSalts = Item.itemRegistry.getObject(new ResourceLocation("Thaumcraft", "ItemBathSalts"));
|
||||
|
||||
warpWardBrew = BotaniaAPI.registerBrewRecipe(ModBrews.warpWard, new ItemStack(Items.nether_wart), new ItemStack(resource, 1, 14), new ItemStack(bathSalts), new ItemStack(resource, 1, 6));
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
@@ -24,7 +25,7 @@ public class HelmRevealingRecipe implements IRecipe {
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting var1, World var2) {
|
||||
Item goggles = Item.itemRegistry.getObject("Thaumcraft:ItemGoggles");
|
||||
Item goggles = Item.itemRegistry.getObject(new ResourceLocation("Thaumcraft", "ItemGoggles"));
|
||||
if(goggles == null)
|
||||
return false; // NO TC loaded
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.entity;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -131,7 +132,8 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark {
|
||||
}
|
||||
|
||||
List<ICorporeaSpark> getNearbySparks() {
|
||||
return worldObj.getEntitiesWithinAABB(ICorporeaSpark.class, new AxisAlignedBB(posX - SCAN_RANGE, posY - SCAN_RANGE, posZ - SCAN_RANGE, posX + SCAN_RANGE, posY + SCAN_RANGE, posZ + SCAN_RANGE));
|
||||
List ret = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(posX - SCAN_RANGE, posY - SCAN_RANGE, posZ - SCAN_RANGE, posX + SCAN_RANGE, posY + SCAN_RANGE, posZ + SCAN_RANGE), Predicates.instanceOf(ICorporeaSpark.class));
|
||||
return ((List<ICorporeaSpark>) ret);
|
||||
}
|
||||
|
||||
void restartNetwork() {
|
||||
|
||||
@@ -881,7 +881,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
|
||||
@Override
|
||||
public boolean matches(World world, BlockPos pos) {
|
||||
return world.getBlockState(pos).getBlock().isBeaconBase(world, pos, pos.add(relPos.multiply(-1)));
|
||||
return world.getBlockState(pos).getBlock().isBeaconBase(world, pos, pos.add(new BlockPos(-relPos.getX(), -relPos.getY(), -relPos.getZ())));
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class EntityFlyingCreature extends EntityAmbientCreature {
|
||||
motionX *= 0.800000011920929D;
|
||||
motionY *= 0.800000011920929D;
|
||||
motionZ *= 0.800000011920929D;
|
||||
} else if(handleLavaMovement()) {
|
||||
} else if(isNotColliding()) {
|
||||
moveFlying(par1, par2, 0.02F);
|
||||
moveEntity(motionX, motionY, motionZ);
|
||||
motionX *= 0.5D;
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.block.BlockLeaves;
|
||||
@@ -162,7 +163,7 @@ public class EntityMagicMissile extends EntityThrowable {
|
||||
setTarget(null);
|
||||
|
||||
double range = 12;
|
||||
List entities = worldObj.getEntitiesWithinAABB(isEvil() ? EntityPlayer.class : IMob.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range));
|
||||
List entities = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range), Predicates.instanceOf(isEvil() ? EntityPlayer.class : IMob.class));
|
||||
while(entities.size() > 0) {
|
||||
Entity e = (Entity) entities.get(worldObj.rand.nextInt(entities.size()));
|
||||
if(!(e instanceof EntityLivingBase) || e.isDead) { // Just in case...
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.entity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -21,6 +22,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -40,7 +42,6 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
private String throwerName;
|
||||
private int ticksInGround;
|
||||
private int ticksInAir;
|
||||
private static final String __OBFID = "CL_00001723";
|
||||
|
||||
public EntityThrowableCopy(World worldIn)
|
||||
{
|
||||
@@ -48,7 +49,9 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
this.setSize(0.25F, 0.25F);
|
||||
}
|
||||
|
||||
protected void entityInit() {}
|
||||
protected void entityInit()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
|
||||
@@ -57,9 +60,15 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isInRangeToRenderDist(double distance)
|
||||
{
|
||||
double d1 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D;
|
||||
d1 *= 64.0D;
|
||||
return distance < d1 * d1;
|
||||
double d0 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D;
|
||||
|
||||
if (Double.isNaN(d0))
|
||||
{
|
||||
d0 = 4.0D;
|
||||
}
|
||||
|
||||
d0 = d0 * 64.0D;
|
||||
return distance < d0 * d0;
|
||||
}
|
||||
|
||||
public EntityThrowableCopy(World worldIn, EntityLivingBase throwerIn)
|
||||
@@ -79,12 +88,12 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, this.getVelocity(), 1.0F);
|
||||
}
|
||||
|
||||
public EntityThrowableCopy(World worldIn, double x, double y, double p_i1778_6_)
|
||||
public EntityThrowableCopy(World worldIn, double x, double y, double z)
|
||||
{
|
||||
super(worldIn);
|
||||
this.ticksInGround = 0;
|
||||
this.setSize(0.25F, 0.25F);
|
||||
this.setPosition(x, y, p_i1778_6_);
|
||||
this.setPosition(x, y, z);
|
||||
}
|
||||
|
||||
protected float getVelocity()
|
||||
@@ -99,27 +108,25 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
|
||||
/**
|
||||
* Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction.
|
||||
*
|
||||
* @param inaccuracy Higher means more error.
|
||||
*/
|
||||
public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy)
|
||||
{
|
||||
float f2 = MathHelper.sqrt_double(x * x + y * y + z * z);
|
||||
x /= (double)f2;
|
||||
y /= (double)f2;
|
||||
z /= (double)f2;
|
||||
x += this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy;
|
||||
y += this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy;
|
||||
z += this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy;
|
||||
x *= (double)velocity;
|
||||
y *= (double)velocity;
|
||||
z *= (double)velocity;
|
||||
float f = MathHelper.sqrt_double(x * x + y * y + z * z);
|
||||
x = x / (double)f;
|
||||
y = y / (double)f;
|
||||
z = z / (double)f;
|
||||
x = x + this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy;
|
||||
y = y + this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy;
|
||||
z = z + this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy;
|
||||
x = x * (double)velocity;
|
||||
y = y * (double)velocity;
|
||||
z = z * (double)velocity;
|
||||
this.motionX = x;
|
||||
this.motionY = y;
|
||||
this.motionZ = z;
|
||||
float f3 = MathHelper.sqrt_double(x * x + z * z);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f3) * 180.0D / Math.PI);
|
||||
float f1 = MathHelper.sqrt_double(x * x + z * z);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(MathHelper.func_181159_b(x, z) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float)(MathHelper.func_181159_b(y, (double)f1) * 180.0D / Math.PI);
|
||||
this.ticksInGround = 0;
|
||||
}
|
||||
|
||||
@@ -136,8 +143,8 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
|
||||
{
|
||||
float f = MathHelper.sqrt_double(x * x + z * z);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f) * 180.0D / Math.PI);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(MathHelper.func_181159_b(x, z) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float)(MathHelper.func_181159_b(y, (double)f) * 180.0D / Math.PI);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +203,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
Entity entity = null;
|
||||
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||
double d0 = 0.0D;
|
||||
EntityLivingBase entitylivingbase = this.getThrower();
|
||||
|
||||
@@ -212,7 +219,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
|
||||
if (movingobjectposition1 != null)
|
||||
{
|
||||
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
||||
double d1 = vec3.squareDistanceTo(movingobjectposition1.hitVec);
|
||||
|
||||
if (d1 < d0 || d0 == 0.0D)
|
||||
{
|
||||
@@ -233,7 +240,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.worldObj.getBlockState(movingobjectposition.getBlockPos()).getBlock() == Blocks.portal)
|
||||
{
|
||||
this.setInPortal();
|
||||
this.func_181015_d(movingobjectposition.getBlockPos());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -245,9 +252,9 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;
|
||||
float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
this.rotationYaw = (float)(MathHelper.func_181159_b(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
|
||||
for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
|
||||
for (this.rotationPitch = (float)(MathHelper.func_181159_b(this.motionY, (double)f1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
|
||||
{
|
||||
;
|
||||
}
|
||||
@@ -311,7 +318,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
tagCompound.setShort("xTile", (short)this.xTile);
|
||||
tagCompound.setShort("yTile", (short)this.yTile);
|
||||
tagCompound.setShort("zTile", (short)this.zTile);
|
||||
ResourceLocation resourcelocation = Block.blockRegistry.getNameForObject(this.inTile);
|
||||
ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(this.inTile);
|
||||
tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString());
|
||||
tagCompound.setByte("shake", (byte)this.throwableShake);
|
||||
tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0));
|
||||
@@ -344,12 +351,15 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
|
||||
this.throwableShake = tagCompund.getByte("shake") & 255;
|
||||
this.inGround = tagCompund.getByte("inGround") == 1;
|
||||
this.thrower = null;
|
||||
this.throwerName = tagCompund.getString("ownerName");
|
||||
|
||||
if (this.throwerName != null && this.throwerName.length() == 0)
|
||||
{
|
||||
this.throwerName = null;
|
||||
}
|
||||
|
||||
this.thrower = this.getThrower();
|
||||
}
|
||||
|
||||
public EntityLivingBase getThrower()
|
||||
@@ -357,6 +367,23 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
|
||||
if (this.thrower == null && this.throwerName != null && this.throwerName.length() > 0)
|
||||
{
|
||||
this.thrower = this.worldObj.getPlayerEntityByName(this.throwerName);
|
||||
|
||||
if (this.thrower == null && this.worldObj instanceof WorldServer)
|
||||
{
|
||||
try
|
||||
{
|
||||
Entity entity = ((WorldServer)this.worldObj).getEntityFromUuid(UUID.fromString(this.throwerName));
|
||||
|
||||
if (entity instanceof EntityLivingBase)
|
||||
{
|
||||
this.thrower = (EntityLivingBase)entity;
|
||||
}
|
||||
}
|
||||
catch (Throwable var2)
|
||||
{
|
||||
this.thrower = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.thrower;
|
||||
|
||||
@@ -99,7 +99,7 @@ public class EntityThrownItem extends EntityItem {
|
||||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && worldObj.getBlockState(movingobjectposition.getBlockPos()).getBlock() == Blocks.portal)
|
||||
{
|
||||
setInPortal();
|
||||
func_181015_d(movingobjectposition.getBlockPos());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -484,20 +485,20 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement {
|
||||
GlStateManager.disableCull();
|
||||
ItemCraftingHalo item = (ItemCraftingHalo) stack.getItem();
|
||||
mc.renderEngine.bindTexture(item.getGlowResource());
|
||||
tess.getWorldRenderer().startDrawingQuads();
|
||||
tess.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||
for(int i = 0; i < segAngles; i++) {
|
||||
float ang = i + seg * segAngles + shift;
|
||||
double xp = Math.cos(ang * Math.PI / 180F) * s;
|
||||
double zp = Math.sin(ang * Math.PI / 180F) * s;
|
||||
|
||||
tess.getWorldRenderer().addVertexWithUV(xp * m, y, zp * m, u, v);
|
||||
tess.getWorldRenderer().addVertexWithUV(xp, y0, zp, u, 0);
|
||||
tess.getWorldRenderer().pos(xp * m, y, zp * m).tex(u, v).endVertex();
|
||||
tess.getWorldRenderer().pos(xp, y0, zp).tex(u, 0).endVertex();
|
||||
|
||||
xp = Math.cos((ang + 1) * Math.PI / 180F) * s;
|
||||
zp = Math.sin((ang + 1) * Math.PI / 180F) * s;
|
||||
|
||||
tess.getWorldRenderer().addVertexWithUV(xp, y0, zp, 0, 0);
|
||||
tess.getWorldRenderer().addVertexWithUV(xp * m, y, zp * m, 0, v);
|
||||
tess.getWorldRenderer().pos(xp, y0, zp).tex(0, 0).endVertex();
|
||||
tess.getWorldRenderer().pos(xp * m, y, zp * m).tex(0, v).endVertex();
|
||||
}
|
||||
y0 = 0;
|
||||
tess.draw();
|
||||
@@ -577,7 +578,7 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement {
|
||||
}
|
||||
|
||||
mc.getRenderItem().renderItemAndEffectIntoGUI(recipe[9], x + 72, y + 18);
|
||||
mc.getRenderItem().renderItemOverlayIntoGUI(mc.fontRendererObj, recipe[9], x + 72, y + 18);
|
||||
mc.getRenderItem().renderItemOverlayIntoGUI(mc.fontRendererObj, recipe[9], x + 72, y + 18, "");
|
||||
|
||||
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
@@ -73,7 +74,7 @@ public class ItemGoldenLaurel extends ItemBauble implements IBaubleRender {
|
||||
float f3 = itemIcon.getMaxV();
|
||||
boolean armor = event.entityPlayer.getCurrentArmor(3) != null;
|
||||
Helper.translateToHeadLevel(event.entityPlayer);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.rotate(-100F, 1F, 0F, 0F);
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
@@ -61,7 +62,7 @@ public class ItemTinyPlanet extends ItemBauble implements IBaubleRender {
|
||||
|
||||
public static void applyEffect(World world, double x, double y, double z) {
|
||||
int range = 8;
|
||||
List<Entity> entities = world.getEntitiesWithinAABB(IManaBurst.class, new AxisAlignedBB(x - range, y - range, z - range, x + range, y + range, z + range));
|
||||
List<Entity> entities = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(x - range, y - range, z - range, x + range, y + range, z + range), Predicates.instanceOf(IManaBurst.class));
|
||||
for(Entity entity : entities) {
|
||||
IManaBurst burst = (IManaBurst) entity;
|
||||
ItemStack lens = burst.getSourceLens();
|
||||
|
||||
@@ -12,6 +12,8 @@ package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -36,8 +38,8 @@ public class ItemUnholyCloak extends ItemHolyCloak {
|
||||
public boolean effectOnDamage(LivingHurtEvent event, EntityPlayer player, ItemStack stack) {
|
||||
if(!event.source.isUnblockable()) {
|
||||
int range = 6;
|
||||
List<IMob> mobs = player.worldObj.getEntitiesWithinAABB(IMob.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
|
||||
for(IMob mob : mobs)
|
||||
List mobs = player.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range), Predicates.instanceOf(IMob.class));
|
||||
for(IMob mob : ((List<IMob>) mobs))
|
||||
if(mob instanceof EntityLivingBase) {
|
||||
EntityLivingBase entity = (EntityLivingBase) mob;
|
||||
entity.attackEntityFrom(DamageSource.causePlayerDamage(player), event.ammount);
|
||||
|
||||
+3
-2
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -56,9 +57,9 @@ public class ItemElementiumShears extends ItemManasteelShears {
|
||||
|
||||
if(count != getMaxItemUseDuration(stack) && count % 5 == 0) {
|
||||
int range = 12;
|
||||
List<IShearable> sheep = player.worldObj.getEntitiesWithinAABB(IShearable.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
|
||||
List sheep = player.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range), Predicates.instanceOf(IShearable.class));
|
||||
if(sheep.size() > 0) {
|
||||
for(IShearable target : sheep) {
|
||||
for(IShearable target : ((List<IShearable>) sheep)) {
|
||||
Entity entity = (Entity) target;
|
||||
if(target.isShearable(stack, entity.worldObj, new BlockPos(entity))) {
|
||||
List<ItemStack> drops = target.onSheared(stack, entity.worldObj, new BlockPos(entity), EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
||||
|
||||
+2
-1
@@ -24,6 +24,7 @@ import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.item.ISequentialBreaker;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
@@ -46,7 +47,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker
|
||||
|
||||
public ItemTerraAxe() {
|
||||
super(BotaniaAPI.terrasteelToolMaterial, LibItemNames.TERRA_AXE);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
public boolean shouldBreak(EntityPlayer player) {
|
||||
|
||||
@@ -103,7 +103,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC
|
||||
PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, slot), (EntityPlayerMP) player);
|
||||
} else {
|
||||
addCursor : {
|
||||
BlockPos relPos = lookPos.getBlockPos().add(originCoords.multiply(-1));
|
||||
BlockPos relPos = lookPos.getBlockPos().add(new BlockPos(-originCoords.getX(), -originCoords.getY(), -originCoords.getZ()));
|
||||
|
||||
for(BlockPos cursor : cursors)
|
||||
if(cursor.equals(relPos)) {
|
||||
|
||||
@@ -76,7 +76,7 @@ public class PageElvenRecipe extends PageRecipe {
|
||||
|
||||
TextureAtlasSprite portalIcon = BlockAlfPortal.portalTex;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
Minecraft.getMinecraft().getRenderItem().renderIcon(gui.getLeft() + 22, gui.getTop() + 36, portalIcon, 48, 48);
|
||||
((GuiScreen) gui).drawTexturedModalRect(gui.getLeft() + 22, gui.getTop() + 36, portalIcon, 48, 48);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -100,7 +100,7 @@ public class PagePetalRecipe<T extends RecipePetals> extends PageRecipe {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderManaBar(IGuiLexiconEntry gui, T recipe, int mx, int my) {
|
||||
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
|
||||
FontRenderer font = Minecraft.getMinecraft().fontRendererObj;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
|
||||
@@ -73,6 +73,11 @@ public final class LibObfuscation {
|
||||
public static final String[] MAX_SPAWN_DELAY = new String[] { "maxSpawnDelay", "field_98293_h", "h" };
|
||||
public static final String[] MIN_SPAWN_DELAY = new String[] { "minSpawnDelay", "field_98283_g", "g" };
|
||||
public static final String[] POTENTIAL_ENTITY_SPAWNS = new String[] { "potentialEntitySpawns", "field_98285_e", "e" }; // Todo 1.8 new name makes no sense -> "minecartToSpawn"
|
||||
public static final String[] SPAWN_DELAY = new String[] { "spawnDelay", "field_98286_b", "a" };
|
||||
public static final String[] PREV_MOB_ROTATION = new String[] { "prevMobRotation", "field_98284_d", "f" };
|
||||
public static final String[] MOB_ROTATION = new String[] { "mobRotation", "field_98287_c", "e" };
|
||||
public static final String[] GET_ENTITY_TO_SPAWN = new String[] { "getEntityNameToSpawn", "func_98276_e", "f" };
|
||||
public static final String[] SPAWN_NEW_ENTITY = new String[] { "spawnNewEntity", "func_180613_a", "a" };
|
||||
|
||||
// GuiIngame
|
||||
public static final String[] REMAINING_HIGHLIGHT_TICKS = new String[] { "remainingHighlightTicks", "field_92017_k", "r" };
|
||||
|
||||
Reference in new issue
Block a user