mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Update mappings
This commit is contained in:
parent
5564bd63ef
commit
08d0e8b7fb
56 changed files with 189 additions and 293 deletions
|
@ -23,12 +23,12 @@ if(hasProperty('buildnumber')){
|
||||||
}
|
}
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.12.2-14.23.1.2599"
|
version = "1.12.2-14.23.4.2739"
|
||||||
runDir = "run"
|
runDir = "run"
|
||||||
mappings = "snapshot_20180119"
|
mappings = "snapshot_20180720"
|
||||||
|
makeObfSourceJar = false
|
||||||
replaceIn "ActuallyAdditions.java"
|
replaceIn "ActuallyAdditions.java"
|
||||||
replace "@VERSION@", project.version.toString()
|
replace "@VERSION@", project.version.toString()
|
||||||
makeObfSourceJar = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.getFront(meta));
|
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.byIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -184,8 +184,8 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getTranslationKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class BlockBreaker extends BlockContainerBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.getFront(meta));
|
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.byIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -98,7 +98,7 @@ public class BlockCoalGenerator extends BlockContainerBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.getHorizontal(meta));
|
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.byHorizontalIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class BlockCoffeeMachine extends BlockContainerBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.getHorizontal(meta));
|
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.byHorizontalIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -163,8 +163,8 @@ public class BlockColoredLamp extends BlockBase{
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return InitBlocks.blockColoredLamp.getUnlocalizedName()+"_"+ALL_LAMP_TYPES[stack.getItemDamage()].regName;
|
return InitBlocks.blockColoredLamp.getTranslationKey()+"_"+ALL_LAMP_TYPES[stack.getItemDamage()].regName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, Entity entityIn, boolean someBool) {
|
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, Entity entityIn, boolean someBool) {
|
||||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_LEGS);
|
addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_LEGS);
|
||||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_WALL_WEST);
|
addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_WALL_WEST);
|
||||||
|
|
|
@ -96,8 +96,8 @@ public class BlockCrystal extends BlockBase{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return stack.getItemDamage() >= ALL_CRYSTALS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+"_"+ALL_CRYSTALS[stack.getItemDamage()].name;
|
return stack.getItemDamage() >= ALL_CRYSTALS.length ? StringUtil.BUGGED_ITEM_NAME : this.getTranslationKey()+"_"+ALL_CRYSTALS[stack.getItemDamage()].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class BlockCrystalCluster extends BlockBase implements IColorProvidingBlo
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.getFront(meta));
|
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.byIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -114,8 +114,7 @@ public class BlockCrystalCluster extends BlockBase implements IColorProvidingBlo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public BlockRenderLayer getRenderLayer(){
|
||||||
public BlockRenderLayer getBlockLayer(){
|
|
||||||
return BlockRenderLayer.TRANSLUCENT;
|
return BlockRenderLayer.TRANSLUCENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class BlockDirectionalBreaker extends BlockContainerBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.getFront(meta));
|
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.byIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class BlockDropper extends BlockContainerBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.getFront(meta));
|
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.byIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
package de.ellpeck.actuallyadditions.mod.blocks;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.RegistryHandler;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.state.BlockFaceShape;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.util.EnumBlockRenderType;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BlockFakeAir extends Block
|
|
||||||
{
|
|
||||||
public BlockFakeAir(String name){
|
|
||||||
super(Material.AIR);
|
|
||||||
setRegistryName(name);
|
|
||||||
setUnlocalizedName("stop");
|
|
||||||
RegistryHandler.BLOCKS_TO_REGISTER.add(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The type of render function called. MODEL for mixed tesr and static model, MODELBLOCK_ANIMATED for TESR-only,
|
|
||||||
* LIQUID for vanilla liquids, INVISIBLE to skip all rendering
|
|
||||||
*/
|
|
||||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
|
||||||
{
|
|
||||||
return EnumBlockRenderType.INVISIBLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
|
|
||||||
{
|
|
||||||
return NULL_AABB;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used to determine ambient occlusion and culling when rebuilding chunks for render
|
|
||||||
*/
|
|
||||||
public boolean isOpaqueCube(IBlockState state)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canCollideCheck(IBlockState state, boolean hitIfLiquid)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Spawns this Block's drops into the World as EntityItems.
|
|
||||||
*/
|
|
||||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether this Block can be replaced directly by other blocks (true for e.g. tall grass)
|
|
||||||
*/
|
|
||||||
public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isFullCube(IBlockState state)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockFaceShape getBlockFaceShape(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
|
|
||||||
{
|
|
||||||
return BlockFaceShape.UNDEFINED;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -73,7 +73,7 @@ public class BlockFarmer extends BlockContainerBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.getHorizontal(meta));
|
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.byHorizontalIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class BlockFluidCollector extends BlockContainerBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.getFront(meta));
|
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.byIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class BlockFurnaceDouble extends BlockContainerBase{
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
boolean isOn = meta >= 4;
|
boolean isOn = meta >= 4;
|
||||||
EnumFacing facing = EnumFacing.getHorizontal(isOn ? meta-4 : meta);
|
EnumFacing facing = EnumFacing.byHorizontalIndex(isOn ? meta-4 : meta);
|
||||||
return this.getDefaultState().withProperty(BlockHorizontal.FACING, facing).withProperty(IS_ON, isOn);
|
return this.getDefaultState().withProperty(BlockHorizontal.FACING, facing).withProperty(IS_ON, isOn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,7 @@ public class BlockGreenhouseGlass extends BlockBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public BlockRenderLayer getRenderLayer() {
|
||||||
public BlockRenderLayer getBlockLayer() {
|
|
||||||
return BlockRenderLayer.CUTOUT;
|
return BlockRenderLayer.CUTOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,8 +92,8 @@ public class BlockInputter extends BlockContainerBase{
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getTranslationKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -112,7 +112,7 @@ public class BlockInputter extends BlockContainerBase{
|
||||||
this.toPick = this.rand.nextInt(NAME_FLAVOR_AMOUNTS)+1;
|
this.toPick = this.rand.nextInt(NAME_FLAVOR_AMOUNTS)+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return StringUtil.localize(this.getUnlocalizedName()+".name")+" ("+StringUtil.localize("tile."+ActuallyAdditions.MODID+".block_inputter.add."+this.toPick+".name")+")";
|
return StringUtil.localize(this.getTranslationKey()+".name")+" ("+StringUtil.localize("tile."+ActuallyAdditions.MODID+".block_inputter.add."+this.toPick+".name")+")";
|
||||||
}
|
}
|
||||||
else return super.getItemStackDisplayName(stack);
|
else return super.getItemStackDisplayName(stack);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ public class BlockItemViewerHopping extends BlockItemViewer{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, Entity entityIn, boolean someBool){
|
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, Entity entityIn, boolean someBool){
|
||||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, BASE_AABB);
|
addCollisionBoxToList(pos, entityBox, collidingBoxes, BASE_AABB);
|
||||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, EAST_AABB);
|
addCollisionBoxToList(pos, entityBox, collidingBoxes, EAST_AABB);
|
||||||
|
@ -98,14 +99,13 @@ public class BlockItemViewerHopping extends BlockItemViewer{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public BlockRenderLayer getRenderLayer(){
|
||||||
public BlockRenderLayer getBlockLayer(){
|
|
||||||
return BlockRenderLayer.CUTOUT_MIPPED;
|
return BlockRenderLayer.CUTOUT_MIPPED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(meta));
|
return this.getDefaultState().withProperty(FACING, EnumFacing.byIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class BlockLampPowerer extends BlockBase{
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
IBlockState state = world.getBlockState(pos);
|
IBlockState state = world.getBlockState(pos);
|
||||||
BlockPos coords = pos.offset(WorldUtil.getDirectionByPistonRotation(state));
|
BlockPos coords = pos.offset(WorldUtil.getDirectionByPistonRotation(state));
|
||||||
this.updateLampsAtPos(world, coords, world.isBlockIndirectlyGettingPowered(pos) > 0, new ArrayList<BlockPos>());
|
this.updateLampsAtPos(world, coords, world.getRedstonePowerFromNeighbors(pos) > 0, new ArrayList<BlockPos>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ public class BlockLampPowerer extends BlockBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.getFront(meta));
|
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.byIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -136,7 +136,7 @@ public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.getFront(meta));
|
return this.getDefaultState().withProperty(BlockDirectional.FACING, EnumFacing.byIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -265,7 +265,7 @@ public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay{
|
||||||
expl = relay.getCompassDisplayString();
|
expl = relay.getCompassDisplayString();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
expl = TextFormatting.GRAY.toString()+TextFormatting.ITALIC+StringUtil.localizeFormatted("info."+ActuallyAdditions.MODID+".laserRelay.mode.noCompasss", StringUtil.localize(ConfigValues.itemCompassConfigurator.getUnlocalizedName()+".name"));
|
expl = TextFormatting.GRAY.toString()+TextFormatting.ITALIC+StringUtil.localizeFormatted("info."+ActuallyAdditions.MODID+".laserRelay.mode.noCompasss", StringUtil.localize(ConfigValues.itemCompassConfigurator.getTranslationKey()+".name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
StringUtil.drawSplitString(minecraft.fontRenderer, expl, resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+15, Integer.MAX_VALUE, StringUtil.DECIMAL_COLOR_WHITE, true);
|
StringUtil.drawSplitString(minecraft.fontRenderer, expl, resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+15, Integer.MAX_VALUE, StringUtil.DECIMAL_COLOR_WHITE, true);
|
||||||
|
|
|
@ -91,8 +91,8 @@ public class BlockMisc extends BlockBase{
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return stack.getItemDamage() >= ALL_MISC_BLOCKS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+"_"+ALL_MISC_BLOCKS[stack.getItemDamage()].name;
|
return stack.getItemDamage() >= ALL_MISC_BLOCKS.length ? StringUtil.BUGGED_ITEM_NAME : this.getTranslationKey()+"_"+ALL_MISC_BLOCKS[stack.getItemDamage()].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -100,7 +100,7 @@ public class BlockOilGenerator extends BlockContainerBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.getHorizontal(meta));
|
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.byHorizontalIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -176,8 +176,8 @@ public class BlockSlabs extends BlockBase{
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getTranslationKey();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class BlockSmileyCloud extends BlockContainerBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.getHorizontal(meta));
|
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.byHorizontalIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -195,8 +195,8 @@ public class BlockTinyTorch extends BlockBase{
|
||||||
|
|
||||||
if(enumfacing.getAxis().isHorizontal()){
|
if(enumfacing.getAxis().isHorizontal()){
|
||||||
EnumFacing enumfacing1 = enumfacing.getOpposite();
|
EnumFacing enumfacing1 = enumfacing.getOpposite();
|
||||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0+0.35D*(double)enumfacing1.getFrontOffsetX(), d1+0.22D, d2+0.35D*(double)enumfacing1.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D);
|
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0+0.35D*(double)enumfacing1.getXOffset(), d1+0.22D, d2+0.35D*(double)enumfacing1.getZOffset(), 0.0D, 0.0D, 0.0D);
|
||||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0+0.35D*(double)enumfacing1.getFrontOffsetX(), d1+0.22D, d2+0.35D*(double)enumfacing1.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D);
|
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0+0.35D*(double)enumfacing1.getXOffset(), d1+0.22D, d2+0.35D*(double)enumfacing1.getZOffset(), 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D);
|
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D);
|
||||||
|
@ -231,8 +231,7 @@ public class BlockTinyTorch extends BlockBase{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public BlockRenderLayer getRenderLayer(){
|
||||||
public BlockRenderLayer getBlockLayer(){
|
|
||||||
return BlockRenderLayer.CUTOUT;
|
return BlockRenderLayer.CUTOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class BlockTreasureChest extends BlockBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.getHorizontal(meta));
|
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.byHorizontalIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -34,8 +34,6 @@ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockWildPlant extends BlockBushBase{
|
public class BlockWildPlant extends BlockBushBase{
|
||||||
|
|
||||||
|
@ -63,7 +61,6 @@ public class BlockWildPlant extends BlockBushBase{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list){
|
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list){
|
||||||
for(int j = 0; j < ALL_WILD_PLANTS.length; j++){
|
for(int j = 0; j < ALL_WILD_PLANTS.length; j++){
|
||||||
list.add(new ItemStack(this, 1, j));
|
list.add(new ItemStack(this, 1, j));
|
||||||
|
@ -127,8 +124,8 @@ public class BlockWildPlant extends BlockBushBase{
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return stack.getItemDamage() >= ALL_WILD_PLANTS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+"_"+ALL_WILD_PLANTS[stack.getItemDamage()].name;
|
return stack.getItemDamage() >= ALL_WILD_PLANTS.length ? StringUtil.BUGGED_ITEM_NAME : this.getTranslationKey()+"_"+ALL_WILD_PLANTS[stack.getItemDamage()].name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class BlockXPSolidifier extends BlockContainerBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta){
|
public IBlockState getStateFromMeta(int meta){
|
||||||
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.getHorizontal(meta));
|
return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.byHorizontalIndex(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -172,7 +172,7 @@ public abstract class BlockContainerBase extends BlockContainer implements ItemB
|
||||||
TileEntity tile = world.getTileEntity(pos);
|
TileEntity tile = world.getTileEntity(pos);
|
||||||
if(tile instanceof TileEntityBase){
|
if(tile instanceof TileEntityBase){
|
||||||
TileEntityBase base = (TileEntityBase)tile;
|
TileEntityBase base = (TileEntityBase)tile;
|
||||||
boolean powered = world.isBlockIndirectlyGettingPowered(pos) > 0;
|
boolean powered = world.getRedstonePowerFromNeighbors(pos) > 0;
|
||||||
boolean wasPowered = base.isRedstonePowered;
|
boolean wasPowered = base.isRedstonePowered;
|
||||||
if(powered && !wasPowered){
|
if(powered && !wasPowered){
|
||||||
if(base.respondsToPulses()){
|
if(base.respondsToPulses()){
|
||||||
|
@ -262,7 +262,7 @@ public abstract class BlockContainerBase extends BlockContainer implements ItemB
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack stack = new ItemStack(this.getItemDropped(state, tile.getWorld().rand, fortune), 1, this.damageDropped(state));
|
ItemStack stack = new ItemStack(this.getItemDropped(state, tile.getWorld().rand, fortune), 1, this.damageDropped(state));
|
||||||
if(!data.hasNoTags()){
|
if(!data.isEmpty()){
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
stack.getTagCompound().setTag("Data", data);
|
stack.getTagCompound().setTag("Data", data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,8 @@ public class ItemBlockBase extends ItemBlock{
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getTranslationKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class ItemDisplay{
|
||||||
|
|
||||||
for(int k = 0; k < list.size(); ++k){
|
for(int k = 0; k < list.size(); ++k){
|
||||||
if(k == 0){
|
if(k == 0){
|
||||||
list.set(k, this.stack.getRarity().rarityColor+list.get(k));
|
list.set(k, this.stack.getRarity().color+list.get(k));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
list.set(k, TextFormatting.GRAY+list.get(k));
|
list.set(k, TextFormatting.GRAY+list.get(k));
|
||||||
|
|
|
@ -20,6 +20,7 @@ import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
|
import net.minecraft.item.crafting.Ingredient;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public final class FoodCrafting{
|
public final class FoodCrafting{
|
||||||
|
@ -44,7 +45,7 @@ public final class FoodCrafting{
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
|
|
||||||
ItemStack knifeStack = new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD);
|
Ingredient knife = Ingredient.fromItem(InitItems.itemKnife);
|
||||||
|
|
||||||
//Rice Bread
|
//Rice Bread
|
||||||
GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RICE_DOUGH.ordinal()),
|
GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RICE_DOUGH.ordinal()),
|
||||||
|
@ -52,7 +53,7 @@ public final class FoodCrafting{
|
||||||
|
|
||||||
//Bacon
|
//Bacon
|
||||||
RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 3, TheFoods.BACON.ordinal()),
|
RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 3, TheFoods.BACON.ordinal()),
|
||||||
knifeStack.copy(), new ItemStack(Items.COOKED_PORKCHOP));
|
knife, new ItemStack(Items.COOKED_PORKCHOP));
|
||||||
recipeBacon = RecipeUtil.lastIRecipe();
|
recipeBacon = RecipeUtil.lastIRecipe();
|
||||||
|
|
||||||
//Baguette
|
//Baguette
|
||||||
|
@ -66,7 +67,7 @@ public final class FoodCrafting{
|
||||||
'M', new ItemStack(Blocks.BROWN_MUSHROOM),
|
'M', new ItemStack(Blocks.BROWN_MUSHROOM),
|
||||||
'C', "cropCarrot",
|
'C', "cropCarrot",
|
||||||
'F', new ItemStack(Items.COOKED_FISH, 1, Util.WILDCARD),
|
'F', new ItemStack(Items.COOKED_FISH, 1, Util.WILDCARD),
|
||||||
'K', knifeStack.copy(),
|
'K', knife,
|
||||||
'H', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()));
|
'H', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()));
|
||||||
recipePizza = RecipeUtil.lastIRecipe();
|
recipePizza = RecipeUtil.lastIRecipe();
|
||||||
|
|
||||||
|
@ -75,7 +76,7 @@ public final class FoodCrafting{
|
||||||
"KT ", "CB ", " T ",
|
"KT ", "CB ", " T ",
|
||||||
'T', new ItemStack(InitItems.itemFoods, 1, TheFoods.TOAST.ordinal()),
|
'T', new ItemStack(InitItems.itemFoods, 1, TheFoods.TOAST.ordinal()),
|
||||||
'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()),
|
'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()),
|
||||||
'K', knifeStack.copy(),
|
'K', knife,
|
||||||
'B', new ItemStack(Items.COOKED_BEEF));
|
'B', new ItemStack(Items.COOKED_BEEF));
|
||||||
recipeHamburger = RecipeUtil.lastIRecipe();
|
recipeHamburger = RecipeUtil.lastIRecipe();
|
||||||
|
|
||||||
|
@ -93,13 +94,13 @@ public final class FoodCrafting{
|
||||||
'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()),
|
'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()),
|
||||||
'F', new ItemStack(Items.COOKED_BEEF, 1, Util.WILDCARD),
|
'F', new ItemStack(Items.COOKED_BEEF, 1, Util.WILDCARD),
|
||||||
'B', new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()),
|
'B', new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()),
|
||||||
'K', knifeStack.copy());
|
'K', knife);
|
||||||
recipeSubSandwich = RecipeUtil.lastIRecipe();
|
recipeSubSandwich = RecipeUtil.lastIRecipe();
|
||||||
|
|
||||||
//French Fry
|
//French Fry
|
||||||
RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 2, TheFoods.FRENCH_FRY.ordinal()),
|
RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 2, TheFoods.FRENCH_FRY.ordinal()),
|
||||||
new ItemStack(Items.BAKED_POTATO),
|
new ItemStack(Items.BAKED_POTATO),
|
||||||
knifeStack.copy());
|
knife);
|
||||||
recipeFrenchFry = RecipeUtil.lastIRecipe();
|
recipeFrenchFry = RecipeUtil.lastIRecipe();
|
||||||
|
|
||||||
//French Fries
|
//French Fries
|
||||||
|
@ -131,7 +132,7 @@ public final class FoodCrafting{
|
||||||
|
|
||||||
//Carrot Juice
|
//Carrot Juice
|
||||||
RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CARROT_JUICE.ordinal()),
|
RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CARROT_JUICE.ordinal()),
|
||||||
new ItemStack(Items.GLASS_BOTTLE), "cropCarrot", knifeStack.copy());
|
new ItemStack(Items.GLASS_BOTTLE), "cropCarrot", knife);
|
||||||
recipeCarrotJuice = RecipeUtil.lastIRecipe();
|
recipeCarrotJuice = RecipeUtil.lastIRecipe();
|
||||||
|
|
||||||
//Spaghetti
|
//Spaghetti
|
||||||
|
@ -143,7 +144,7 @@ public final class FoodCrafting{
|
||||||
|
|
||||||
//Noodle
|
//Noodle
|
||||||
RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()),
|
RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()),
|
||||||
"cropWheat", knifeStack.copy());
|
"cropWheat", knife);
|
||||||
recipeNoodle = RecipeUtil.lastIRecipe();
|
recipeNoodle = RecipeUtil.lastIRecipe();
|
||||||
|
|
||||||
//Chocolate
|
//Chocolate
|
||||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||||
public class RecipeBioMash extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe{
|
public class RecipeBioMash extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe{
|
||||||
|
|
||||||
public RecipeBioMash(ResourceLocation location){
|
public RecipeBioMash(ResourceLocation location){
|
||||||
RecipeHelper.addRecipe(location.getResourcePath(), this);
|
RecipeHelper.addRecipe(location.getPath(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class RecipeKeepDataShaped extends ShapedOreRecipe{
|
||||||
super(group, result, recipe);
|
super(group, result, recipe);
|
||||||
this.nbtCopyStack = nbtCopyStack;
|
this.nbtCopyStack = nbtCopyStack;
|
||||||
|
|
||||||
RecipeHelper.addRecipe(group.getResourcePath(), this);
|
RecipeHelper.addRecipe(group.getPath(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class RecipeKeepDataShapeless extends ShapelessOreRecipe{
|
||||||
super(group, result, recipe);
|
super(group, result, recipe);
|
||||||
this.nbtCopyStack = nbtCopyStack;
|
this.nbtCopyStack = nbtCopyStack;
|
||||||
|
|
||||||
RecipeHelper.addRecipe(group.getResourcePath(), this);
|
RecipeHelper.addRecipe(group.getPath(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -26,7 +26,7 @@ import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||||
public class RecipePotionRingCharging extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe{
|
public class RecipePotionRingCharging extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe{
|
||||||
|
|
||||||
public RecipePotionRingCharging(ResourceLocation location){
|
public RecipePotionRingCharging(ResourceLocation location){
|
||||||
RecipeHelper.addRecipe(location.getResourcePath(), this);
|
RecipeHelper.addRecipe(location.getPath(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class CreativeTab extends CreativeTabs{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getTabIconItem(){
|
public ItemStack createIcon(){
|
||||||
return new ItemStack(InitItems.itemBooklet);
|
return new ItemStack(InitItems.itemBooklet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ public class ClientEvents{
|
||||||
event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+Item.REGISTRY.getNameForObject(event.getItemStack().getItem()));
|
event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+Item.REGISTRY.getNameForObject(event.getItemStack().getItem()));
|
||||||
|
|
||||||
//Base Item's Unlocalized Name
|
//Base Item's Unlocalized Name
|
||||||
String baseName = event.getItemStack().getItem().getUnlocalizedName();
|
String baseName = event.getItemStack().getItem().getTranslationKey();
|
||||||
if(baseName != null){
|
if(baseName != null){
|
||||||
event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ActuallyAdditions.MODID+".baseUnlocName.desc")+":");
|
event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ActuallyAdditions.MODID+".baseUnlocName.desc")+":");
|
||||||
event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+baseName);
|
event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+baseName);
|
||||||
|
@ -129,7 +129,7 @@ public class ClientEvents{
|
||||||
event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+meta+(max > 0 ? "/"+max : ""));
|
event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+meta+(max > 0 ? "/"+max : ""));
|
||||||
|
|
||||||
//Unlocalized Name
|
//Unlocalized Name
|
||||||
String metaName = event.getItemStack().getItem().getUnlocalizedName(event.getItemStack());
|
String metaName = event.getItemStack().getItem().getTranslationKey(event.getItemStack());
|
||||||
if(metaName != null && baseName != null && !metaName.equals(baseName)){
|
if(metaName != null && baseName != null && !metaName.equals(baseName)){
|
||||||
event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ActuallyAdditions.MODID+".unlocName.desc")+":");
|
event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ActuallyAdditions.MODID+".unlocName.desc")+":");
|
||||||
event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+metaName);
|
event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+metaName);
|
||||||
|
@ -137,7 +137,7 @@ public class ClientEvents{
|
||||||
|
|
||||||
//NBT
|
//NBT
|
||||||
NBTTagCompound compound = event.getItemStack().getTagCompound();
|
NBTTagCompound compound = event.getItemStack().getTagCompound();
|
||||||
if(compound != null && !compound.hasNoTags()){
|
if(compound != null && !compound.isEmpty()){
|
||||||
event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ActuallyAdditions.MODID+".nbt.desc")+":");
|
event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ActuallyAdditions.MODID+".nbt.desc")+":");
|
||||||
if(GuiScreen.isShiftKeyDown()){
|
if(GuiScreen.isShiftKeyDown()){
|
||||||
int limit = ConfigIntValues.CTRL_INFO_NBT_CHAR_LIMIT.getValue();
|
int limit = ConfigIntValues.CTRL_INFO_NBT_CHAR_LIMIT.getValue();
|
||||||
|
@ -205,7 +205,7 @@ public class ClientEvents{
|
||||||
expl = TextFormatting.GREEN+StringUtil.localize("info."+ActuallyAdditions.MODID+".redstoneMode.validItem");
|
expl = TextFormatting.GREEN+StringUtil.localize("info."+ActuallyAdditions.MODID+".redstoneMode.validItem");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
expl = TextFormatting.GRAY.toString()+TextFormatting.ITALIC+StringUtil.localizeFormatted("info."+ActuallyAdditions.MODID+".redstoneMode.invalidItem", StringUtil.localize(ConfigValues.itemRedstoneTorchConfigurator.getUnlocalizedName()+".name"));
|
expl = TextFormatting.GRAY.toString()+TextFormatting.ITALIC+StringUtil.localizeFormatted("info."+ActuallyAdditions.MODID+".redstoneMode.invalidItem", StringUtil.localize(ConfigValues.itemRedstoneTorchConfigurator.getTranslationKey()+".name"));
|
||||||
}
|
}
|
||||||
font.drawStringWithShadow(expl, event.getResolution().getScaledWidth()/2+5, event.getResolution().getScaledHeight()/2+15, StringUtil.DECIMAL_COLOR_WHITE);
|
font.drawStringWithShadow(expl, event.getResolution().getScaledWidth()/2+5, event.getResolution().getScaledHeight()/2+15, StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,14 +118,14 @@ public class OreGen implements IWorldGenerator{
|
||||||
//Generate Treasure Chests
|
//Generate Treasure Chests
|
||||||
if(ConfigBoolValues.DO_TREASURE_CHEST_GEN.isEnabled()){
|
if(ConfigBoolValues.DO_TREASURE_CHEST_GEN.isEnabled()){
|
||||||
if(event.getRand().nextInt(40) == 0){
|
if(event.getRand().nextInt(40) == 0){
|
||||||
BlockPos randomPos = new BlockPos(event.getPos().getX()+event.getRand().nextInt(16)+8, 0, event.getPos().getZ()+event.getRand().nextInt(16)+8);
|
BlockPos randomPos = event.getChunkPos().getBlock(event.getRand().nextInt(16)+8, 0, event.getRand().nextInt(16)+8);
|
||||||
randomPos = event.getWorld().getTopSolidOrLiquidBlock(randomPos);
|
randomPos = event.getWorld().getTopSolidOrLiquidBlock(randomPos);
|
||||||
|
|
||||||
if(event.getWorld().getBiome(randomPos) instanceof BiomeOcean){
|
if(event.getWorld().getBiome(randomPos) instanceof BiomeOcean){
|
||||||
if(randomPos.getY() >= 25 && randomPos.getY() <= 45){
|
if(randomPos.getY() >= 25 && randomPos.getY() <= 45){
|
||||||
if(event.getWorld().getBlockState(randomPos).getMaterial() == Material.WATER){
|
if(event.getWorld().getBlockState(randomPos).getMaterial() == Material.WATER){
|
||||||
if(event.getWorld().getBlockState(randomPos.down()).getMaterial().isSolid()){
|
if(event.getWorld().getBlockState(randomPos.down()).getMaterial().isSolid()){
|
||||||
event.getWorld().setBlockState(randomPos, InitBlocks.blockTreasureChest.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.getHorizontal(event.getRand().nextInt(4))), 2);
|
event.getWorld().setBlockState(randomPos, InitBlocks.blockTreasureChest.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.byHorizontalIndex(event.getRand().nextInt(4))), 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ public class OreGen implements IWorldGenerator{
|
||||||
if(ConfigBoolValues.DO_RICE_GEN.isEnabled()){
|
if(ConfigBoolValues.DO_RICE_GEN.isEnabled()){
|
||||||
for(int i = 0; i < ConfigIntValues.RICE_AMOUNT.getValue(); i++){
|
for(int i = 0; i < ConfigIntValues.RICE_AMOUNT.getValue(); i++){
|
||||||
if(event.getRand().nextInt(3) == 0){
|
if(event.getRand().nextInt(3) == 0){
|
||||||
BlockPos randomPos = new BlockPos(event.getPos().getX()+event.getRand().nextInt(16)+8, 0, event.getPos().getZ()+event.getRand().nextInt(16)+8);
|
BlockPos randomPos = event.getChunkPos().getBlock(event.getRand().nextInt(16)+8, 0, event.getRand().nextInt(16)+8);
|
||||||
randomPos = event.getWorld().getTopSolidOrLiquidBlock(randomPos);
|
randomPos = event.getWorld().getTopSolidOrLiquidBlock(randomPos);
|
||||||
if(event.getWorld().getBlockState(randomPos).getMaterial() == Material.WATER){
|
if(event.getWorld().getBlockState(randomPos).getMaterial() == Material.WATER){
|
||||||
ArrayList<Material> blocksAroundBottom = WorldUtil.getMaterialsAround(event.getWorld(), randomPos);
|
ArrayList<Material> blocksAroundBottom = WorldUtil.getMaterialsAround(event.getWorld(), randomPos);
|
||||||
|
@ -161,7 +161,7 @@ public class OreGen implements IWorldGenerator{
|
||||||
if(doIt){
|
if(doIt){
|
||||||
for(int i = 0; i < amount; i++){
|
for(int i = 0; i < amount; i++){
|
||||||
if(event.getRand().nextInt(100) == 0){
|
if(event.getRand().nextInt(100) == 0){
|
||||||
BlockPos randomPos = new BlockPos(event.getPos().getX()+event.getRand().nextInt(16)+8, 0, event.getPos().getZ()+event.getRand().nextInt(16)+8);
|
BlockPos randomPos = event.getChunkPos().getBlock(event.getRand().nextInt(16)+8, 0, event.getRand().nextInt(16)+8);
|
||||||
randomPos = event.getWorld().getTopSolidOrLiquidBlock(randomPos);
|
randomPos = event.getWorld().getTopSolidOrLiquidBlock(randomPos);
|
||||||
|
|
||||||
if(event.getWorld().getBlockState(randomPos.down()).getMaterial() == blockBelow){
|
if(event.getWorld().getBlockState(randomPos.down()).getMaterial() == blockBelow){
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class FluidDisplay extends Gui{
|
||||||
this.oldFluid = fluid;
|
this.oldFluid = fluid;
|
||||||
|
|
||||||
if(fluid != null && fluid.getStill() != null){
|
if(fluid != null && fluid.getStill() != null){
|
||||||
this.resLoc = new ResourceLocation(fluid.getStill().getResourceDomain(), "textures/"+fluid.getStill().getResourcePath()+".png");
|
this.resLoc = new ResourceLocation(fluid.getStill().getNamespace(), "textures/"+fluid.getStill().getPath()+".png");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,8 @@ public class ItemCrystal extends ItemBase{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return stack.getItemDamage() >= BlockCrystal.ALL_CRYSTALS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+"_"+BlockCrystal.ALL_CRYSTALS[stack.getItemDamage()].name;
|
return stack.getItemDamage() >= BlockCrystal.ALL_CRYSTALS.length ? StringUtil.BUGGED_ITEM_NAME : this.getTranslationKey()+"_"+BlockCrystal.ALL_CRYSTALS[stack.getItemDamage()].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,8 @@ public class ItemCrystalShard extends ItemBase implements IColorProvidingItem{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return stack.getItemDamage() >= BlockCrystal.ALL_CRYSTALS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+"_"+BlockCrystal.ALL_CRYSTALS[stack.getItemDamage()].name;
|
return stack.getItemDamage() >= BlockCrystal.ALL_CRYSTALS.length ? StringUtil.BUGGED_ITEM_NAME : this.getTranslationKey()+"_"+BlockCrystal.ALL_CRYSTALS[stack.getItemDamage()].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,8 @@ public class ItemDust extends ItemBase implements IColorProvidingItem{
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return stack.getItemDamage() >= ALL_DUSTS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+"_"+ALL_DUSTS[stack.getItemDamage()].name;
|
return stack.getItemDamage() >= ALL_DUSTS.length ? StringUtil.BUGGED_ITEM_NAME : this.getTranslationKey()+"_"+ALL_DUSTS[stack.getItemDamage()].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -82,8 +82,8 @@ public class ItemFoods extends ItemFoodBase{
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return stack.getItemDamage() >= ALL_FOODS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+"_"+ALL_FOODS[stack.getItemDamage()].name;
|
return stack.getItemDamage() >= ALL_FOODS.length ? StringUtil.BUGGED_ITEM_NAME : this.getTranslationKey()+"_"+ALL_FOODS[stack.getItemDamage()].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,8 @@ public class ItemJams extends ItemFoodBase implements IColorProvidingItem{
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return stack.getItemDamage() >= ALL_JAMS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+"_"+ALL_JAMS[stack.getItemDamage()].name;
|
return stack.getItemDamage() >= ALL_JAMS.length ? StringUtil.BUGGED_ITEM_NAME : this.getTranslationKey()+"_"+ALL_JAMS[stack.getItemDamage()].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,8 @@ public class ItemMisc extends ItemBase{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return stack.getItemDamage() >= ALL_MISC_ITEMS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+"_"+ALL_MISC_ITEMS[stack.getItemDamage()].name;
|
return stack.getItemDamage() >= ALL_MISC_ITEMS.length ? StringUtil.BUGGED_ITEM_NAME : this.getTranslationKey()+"_"+ALL_MISC_ITEMS[stack.getItemDamage()].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -91,8 +91,8 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getTranslationKey(ItemStack stack){
|
||||||
return stack.getItemDamage() >= ALL_RINGS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_RINGS[stack.getItemDamage()].name;
|
return stack.getItemDamage() >= ALL_RINGS.length ? StringUtil.BUGGED_ITEM_NAME : this.getTranslationKey()+ALL_RINGS[stack.getItemDamage()].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -131,14 +131,14 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi
|
||||||
@Override
|
@Override
|
||||||
public String getItemStackDisplayName(ItemStack stack){
|
public String getItemStackDisplayName(ItemStack stack){
|
||||||
if(Util.isClient()) {
|
if(Util.isClient()) {
|
||||||
String standardName = StringUtil.localize(this.getUnlocalizedName()+".name");
|
String standardName = StringUtil.localize(this.getTranslationKey()+".name");
|
||||||
if(stack.getItemDamage() < ALL_RINGS.length){
|
if(stack.getItemDamage() < ALL_RINGS.length){
|
||||||
String effect = StringUtil.localize(ALL_RINGS[stack.getItemDamage()].name);
|
String effect = StringUtil.localize(ALL_RINGS[stack.getItemDamage()].name);
|
||||||
return standardName+" "+effect;
|
return standardName+" "+effect;
|
||||||
}
|
}
|
||||||
return standardName;
|
return standardName;
|
||||||
}
|
}
|
||||||
String standardName = StringUtil.localizeIllegallyOnTheServerDontUseMePls(this.getUnlocalizedName()+".name");
|
String standardName = StringUtil.localizeIllegallyOnTheServerDontUseMePls(this.getTranslationKey()+".name");
|
||||||
if(stack.getItemDamage() < ALL_RINGS.length){
|
if(stack.getItemDamage() < ALL_RINGS.length){
|
||||||
String effect = StringUtil.localizeIllegallyOnTheServerDontUseMePls(ALL_RINGS[stack.getItemDamage()].name);
|
String effect = StringUtil.localizeIllegallyOnTheServerDontUseMePls(ALL_RINGS[stack.getItemDamage()].name);
|
||||||
return standardName+" "+effect;
|
return standardName+" "+effect;
|
||||||
|
|
|
@ -90,8 +90,8 @@ public class FilterSettings{
|
||||||
ResourceLocation firstReg = firstItem.getRegistryName();
|
ResourceLocation firstReg = firstItem.getRegistryName();
|
||||||
ResourceLocation secondReg = secondItem.getRegistryName();
|
ResourceLocation secondReg = secondItem.getRegistryName();
|
||||||
if(firstReg != null && secondReg != null){
|
if(firstReg != null && secondReg != null){
|
||||||
String firstDomain = firstReg.getResourceDomain();
|
String firstDomain = firstReg.getNamespace();
|
||||||
String secondDomain = secondReg.getResourceDomain();
|
String secondDomain = secondReg.getNamespace();
|
||||||
if(firstDomain != null && secondDomain != null){
|
if(firstDomain != null && secondDomain != null){
|
||||||
if(!firstDomain.equals(secondDomain)){
|
if(!firstDomain.equals(secondDomain)){
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -23,6 +23,7 @@ import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ITickable;
|
import net.minecraft.util.ITickable;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.text.TextComponentTranslation;
|
import net.minecraft.util.text.TextComponentTranslation;
|
||||||
|
@ -116,7 +117,7 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{
|
||||||
private static void register(Class<? extends TileEntityBase> tileClass){
|
private static void register(Class<? extends TileEntityBase> tileClass){
|
||||||
try{
|
try{
|
||||||
//This is hacky and dirty but it works so whatever
|
//This is hacky and dirty but it works so whatever
|
||||||
String name = ActuallyAdditions.MODID+":"+tileClass.newInstance().name;
|
ResourceLocation name = new ResourceLocation(ActuallyAdditions.MODID, tileClass.newInstance().name);
|
||||||
GameRegistry.registerTileEntity(tileClass, name);
|
GameRegistry.registerTileEntity(tileClass, name);
|
||||||
}
|
}
|
||||||
catch(Exception e){
|
catch(Exception e){
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class TileEntityFarmer extends TileEntityInventoryBase implements IFarmer
|
||||||
|
|
||||||
IBlockState state = this.world.getBlockState(this.pos);
|
IBlockState state = this.world.getBlockState(this.pos);
|
||||||
int meta = state.getBlock().getMetaFromState(state);
|
int meta = state.getBlock().getMetaFromState(state);
|
||||||
BlockPos center = this.pos.offset(EnumFacing.getHorizontal(meta), radiusAroundCenter + 1);
|
BlockPos center = this.pos.offset(EnumFacing.byHorizontalIndex(meta), radiusAroundCenter + 1);
|
||||||
|
|
||||||
BlockPos query = center.add(this.checkX, 0, this.checkY);
|
BlockPos query = center.add(this.checkX, 0, this.checkY);
|
||||||
this.checkBehaviors(query);
|
this.checkBehaviors(query);
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase{
|
||||||
|
|
||||||
if(input.hasTagCompound()){
|
if(input.hasTagCompound()){
|
||||||
//TiCon un-break tools
|
//TiCon un-break tools
|
||||||
if("tconstruct".equalsIgnoreCase(input.getItem().getRegistryName().getResourceDomain())){
|
if("tconstruct".equalsIgnoreCase(input.getItem().getRegistryName().getNamespace())){
|
||||||
NBTTagCompound stats = input.getTagCompound().getCompoundTag("Stats");
|
NBTTagCompound stats = input.getTagCompound().getCompoundTag("Stats");
|
||||||
stats.removeTag("Broken");
|
stats.removeTag("Broken");
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ public abstract class TileEntityLaserRelay extends TileEntityInventoryBase{
|
||||||
ActuallyAdditionsAPI.connectionHandler.removeRelayFromNetwork(this.pos, this.world);
|
ActuallyAdditionsAPI.connectionHandler.removeRelayFromNetwork(this.pos, this.world);
|
||||||
|
|
||||||
NBTTagList list = compound.getTagList("Connections", 10);
|
NBTTagList list = compound.getTagList("Connections", 10);
|
||||||
if(!list.hasNoTags()){
|
if(!list.isEmpty()){
|
||||||
for(int i = 0; i < list.tagCount(); i++){
|
for(int i = 0; i < list.tagCount(); i++){
|
||||||
ConnectionPair pair = new ConnectionPair();
|
ConnectionPair pair = new ConnectionPair();
|
||||||
pair.readFromNBT(list.getCompoundTagAt(i));
|
pair.readFromNBT(list.getCompoundTagAt(i));
|
||||||
|
|
|
@ -271,7 +271,7 @@ public final class AssetUtil{
|
||||||
double pitch = Math.atan2(combinedVec.y, Math.sqrt(combinedVec.x*combinedVec.x+combinedVec.z*combinedVec.z));
|
double pitch = Math.atan2(combinedVec.y, Math.sqrt(combinedVec.x*combinedVec.x+combinedVec.z*combinedVec.z));
|
||||||
double yaw = Math.atan2(-combinedVec.z, combinedVec.x);
|
double yaw = Math.atan2(-combinedVec.z, combinedVec.x);
|
||||||
|
|
||||||
double length = combinedVec.lengthVector();
|
double length = combinedVec.length();
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ public final class ItemUtil{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerBlock(Block block, ItemBlockBase itemBlock, String name, boolean addTab){
|
public static void registerBlock(Block block, ItemBlockBase itemBlock, String name, boolean addTab){
|
||||||
block.setUnlocalizedName(ActuallyAdditions.MODID+"."+name);
|
block.setTranslationKey(ActuallyAdditions.MODID+"."+name);
|
||||||
|
|
||||||
block.setRegistryName(ActuallyAdditions.MODID, name);
|
block.setRegistryName(ActuallyAdditions.MODID, name);
|
||||||
RegistryHandler.BLOCKS_TO_REGISTER.add(block);
|
RegistryHandler.BLOCKS_TO_REGISTER.add(block);
|
||||||
|
@ -54,7 +54,7 @@ public final class ItemUtil{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerItem(Item item, String name, boolean addTab){
|
public static void registerItem(Item item, String name, boolean addTab){
|
||||||
item.setUnlocalizedName(ActuallyAdditions.MODID+"."+name);
|
item.setTranslationKey(ActuallyAdditions.MODID+"."+name);
|
||||||
|
|
||||||
item.setRegistryName(ActuallyAdditions.MODID, name);
|
item.setRegistryName(ActuallyAdditions.MODID, name);
|
||||||
RegistryHandler.ITEMS_TO_REGISTER.add(item);
|
RegistryHandler.ITEMS_TO_REGISTER.add(item);
|
||||||
|
@ -126,7 +126,7 @@ public final class ItemUtil{
|
||||||
ench.removeTag(i);
|
ench.removeTag(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(ench.hasNoTags() && stack.hasTagCompound()){
|
if(ench.isEmpty() && stack.hasTagCompound()){
|
||||||
stack.getTagCompound().removeTag("ench");
|
stack.getTagCompound().removeTag("ench");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,7 +264,7 @@ public final class WorldUtil {
|
||||||
float f5 = MathHelper.sin(-f * 0.017453292F);
|
float f5 = MathHelper.sin(-f * 0.017453292F);
|
||||||
float f6 = f3 * f4;
|
float f6 = f3 * f4;
|
||||||
float f7 = f2 * f4;
|
float f7 = f2 * f4;
|
||||||
Vec3d vec31 = vec3.addVector((double) f6 * distance, (double) f5 * distance, (double) f7 * distance);
|
Vec3d vec31 = vec3.add((double) f6 * distance, (double) f5 * distance, (double) f7 * distance);
|
||||||
return world.rayTraceBlocks(vec3, vec31, p1, p2, p3);
|
return world.rayTraceBlocks(vec3, vec31, p1, p2, p3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ public final class WorldUtil {
|
||||||
|
|
||||||
if (player.capabilities.isCreativeMode) {
|
if (player.capabilities.isCreativeMode) {
|
||||||
if (block.removedByPlayer(state, world, pos, player, false)) {
|
if (block.removedByPlayer(state, world, pos, player, false)) {
|
||||||
block.onBlockDestroyedByPlayer(world, pos, state);
|
block.onPlayerDestroy(world, pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
// send update to client
|
// send update to client
|
||||||
|
@ -331,7 +331,7 @@ public final class WorldUtil {
|
||||||
|
|
||||||
TileEntity tileEntity = world.getTileEntity(pos);
|
TileEntity tileEntity = world.getTileEntity(pos);
|
||||||
if (block.removedByPlayer(state, world, pos, player, true)) { // boolean is if block can be harvested, checked above
|
if (block.removedByPlayer(state, world, pos, player, true)) { // boolean is if block can be harvested, checked above
|
||||||
block.onBlockDestroyedByPlayer(world, pos, state);
|
block.onPlayerDestroy(world, pos, state);
|
||||||
block.harvestBlock(world, player, pos, state, tileEntity, stack);
|
block.harvestBlock(world, player, pos, state, tileEntity, stack);
|
||||||
block.dropXpOnBlockBreak(world, pos, xp);
|
block.dropXpOnBlockBreak(world, pos, xp);
|
||||||
}
|
}
|
||||||
|
@ -348,7 +348,7 @@ public final class WorldUtil {
|
||||||
// following code can be found in PlayerControllerMP.onPlayerDestroyBlock
|
// following code can be found in PlayerControllerMP.onPlayerDestroyBlock
|
||||||
world.playEvent(2001, pos, Block.getStateId(state));
|
world.playEvent(2001, pos, Block.getStateId(state));
|
||||||
if (block.removedByPlayer(state, world, pos, player, true)) {
|
if (block.removedByPlayer(state, world, pos, player, true)) {
|
||||||
block.onBlockDestroyedByPlayer(world, pos, state);
|
block.onPlayerDestroy(world, pos, state);
|
||||||
}
|
}
|
||||||
// callback to the tool
|
// callback to the tool
|
||||||
stack.onBlockDestroyed(world, state, pos, player);
|
stack.onBlockDestroyed(world, state, pos, player);
|
||||||
|
|
|
@ -42,8 +42,7 @@ public final class RecipeHelper{
|
||||||
if (i instanceof IDisableableItem && ((IDisableableItem) i).isDisabled()) rec = new BlankRecipe();
|
if (i instanceof IDisableableItem && ((IDisableableItem) i).isDisabled()) rec = new BlankRecipe();
|
||||||
if (rec.getRegistryName() == null) {
|
if (rec.getRegistryName() == null) {
|
||||||
RECIPE_LIST.add(rec.setRegistryName(new ResourceLocation(MODID, name)));
|
RECIPE_LIST.add(rec.setRegistryName(new ResourceLocation(MODID, name)));
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
RECIPE_LIST.add(rec);
|
RECIPE_LIST.add(rec);
|
||||||
}
|
}
|
||||||
RecipeHandler.lastRecipe = rec;
|
RecipeHandler.lastRecipe = rec;
|
||||||
|
@ -54,8 +53,7 @@ public final class RecipeHelper{
|
||||||
*/
|
*/
|
||||||
public static void addOldShaped(ItemStack output, Object... input) {
|
public static void addOldShaped(ItemStack output, Object... input) {
|
||||||
ShapedPrimer primer = CraftingHelper.parseShaped(input);
|
ShapedPrimer primer = CraftingHelper.parseShaped(input);
|
||||||
addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, "recipes"+j).toString(), primer.width,
|
addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, "recipes" + j).toString(), primer.width, primer.height, primer.input, output));
|
||||||
primer.height, primer.input, output));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -63,8 +61,7 @@ public final class RecipeHelper{
|
||||||
*/
|
*/
|
||||||
public static void addOldShaped(String group, ItemStack output, Object... input) {
|
public static void addOldShaped(String group, ItemStack output, Object... input) {
|
||||||
ShapedPrimer primer = CraftingHelper.parseShaped(input);
|
ShapedPrimer primer = CraftingHelper.parseShaped(input);
|
||||||
addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, group).toString(), primer.width, primer.height,
|
addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, group).toString(), primer.width, primer.height, primer.input, output));
|
||||||
primer.input, output));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -72,16 +69,14 @@ public final class RecipeHelper{
|
||||||
*/
|
*/
|
||||||
public static void addOldShaped(String name, String group, ItemStack output, Object... input) {
|
public static void addOldShaped(String name, String group, ItemStack output, Object... input) {
|
||||||
ShapedPrimer primer = CraftingHelper.parseShaped(input);
|
ShapedPrimer primer = CraftingHelper.parseShaped(input);
|
||||||
addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, group).toString(), primer.width, primer.height,
|
addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, group).toString(), primer.width, primer.height, primer.input, output).setRegistryName(MODID, name));
|
||||||
primer.input, output).setRegistryName(MODID, name));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This adds a shapeless recipe to the list of crafting recipes, using the forge format.
|
* This adds a shapeless recipe to the list of crafting recipes, using the forge format.
|
||||||
*/
|
*/
|
||||||
public static void addOldShapeless(ItemStack output, Object... input) {
|
public static void addOldShapeless(ItemStack output, Object... input) {
|
||||||
addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, "recipes"+j).toString(), output,
|
addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, "recipes" + j).toString(), output, createInput(input)));
|
||||||
createInput(input)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -92,8 +87,7 @@ public final class RecipeHelper{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addOldShapeless(String name, String group, ItemStack output, Object... input) {
|
public static void addOldShapeless(String name, String group, ItemStack output, Object... input) {
|
||||||
addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, group).toString(), output, createInput(input))
|
addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, group).toString(), output, createInput(input)).setRegistryName(MODID, name));
|
||||||
.setRegistryName(MODID, name));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -162,26 +156,19 @@ public final class RecipeHelper{
|
||||||
if (input[0] instanceof Object[]) {
|
if (input[0] instanceof Object[]) {
|
||||||
input = (Object[]) input[0];
|
input = (Object[]) input[0];
|
||||||
}
|
}
|
||||||
if(l*w != input.length){
|
if (l * w != input.length) { throw new UnsupportedOperationException("Attempted to add invalid shaped recipe. Complain to the author of " + MODNAME); }
|
||||||
throw new UnsupportedOperationException(
|
|
||||||
"Attempted to add invalid shaped recipe. Complain to the author of "+MODNAME);
|
|
||||||
}
|
|
||||||
NonNullList<Ingredient> inputL = NonNullList.create();
|
NonNullList<Ingredient> inputL = NonNullList.create();
|
||||||
for (int i = 0; i < input.length; i++) {
|
for (int i = 0; i < input.length; i++) {
|
||||||
Object k = input[i];
|
Object k = input[i];
|
||||||
if (k instanceof String) {
|
if (k instanceof String) {
|
||||||
inputL.add(i, new OreIngredient((String) k));
|
inputL.add(i, new OreIngredient((String) k));
|
||||||
}
|
} else if (k instanceof ItemStack && !((ItemStack) k).isEmpty()) {
|
||||||
else if(k instanceof ItemStack && !((ItemStack)k).isEmpty()){
|
|
||||||
inputL.add(i, Ingredient.fromStacks((ItemStack) k));
|
inputL.add(i, Ingredient.fromStacks((ItemStack) k));
|
||||||
}
|
} else if (k instanceof Item) {
|
||||||
else if(k instanceof Item){
|
|
||||||
inputL.add(i, Ingredient.fromStacks(new ItemStack((Item) k)));
|
inputL.add(i, Ingredient.fromStacks(new ItemStack((Item) k)));
|
||||||
}
|
} else if (k instanceof Block) {
|
||||||
else if(k instanceof Block){
|
|
||||||
inputL.add(i, Ingredient.fromStacks(new ItemStack((Block) k)));
|
inputL.add(i, Ingredient.fromStacks(new ItemStack((Block) k)));
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
inputL.add(i, Ingredient.EMPTY);
|
inputL.add(i, Ingredient.EMPTY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,30 +179,24 @@ public final class RecipeHelper{
|
||||||
public static ShapedRecipes genShaped(String group, ItemStack output, int l, int w, Object[] input) {
|
public static ShapedRecipes genShaped(String group, ItemStack output, int l, int w, Object[] input) {
|
||||||
if (input[0] instanceof List) {
|
if (input[0] instanceof List) {
|
||||||
input = ((List<?>) input[0]).toArray();
|
input = ((List<?>) input[0]).toArray();
|
||||||
}
|
} else if (input[0] instanceof Object[]) {
|
||||||
else if(input[0] instanceof Object[]){
|
|
||||||
input = (Object[]) input[0];
|
input = (Object[]) input[0];
|
||||||
}
|
}
|
||||||
if(l*w != input.length){
|
if (l * w != input.length) { throw new UnsupportedOperationException("Attempted to add invalid shaped recipe. Complain to the author of " + MODNAME); }
|
||||||
throw new UnsupportedOperationException(
|
|
||||||
"Attempted to add invalid shaped recipe. Complain to the author of "+MODNAME);
|
|
||||||
}
|
|
||||||
NonNullList<Ingredient> inputL = NonNullList.create();
|
NonNullList<Ingredient> inputL = NonNullList.create();
|
||||||
for (int i = 0; i < input.length; i++) {
|
for (int i = 0; i < input.length; i++) {
|
||||||
Object k = input[i];
|
Object k = input[i];
|
||||||
if (k instanceof String) {
|
if (k instanceof String) {
|
||||||
inputL.add(i, new OreIngredient((String) k));
|
inputL.add(i, new OreIngredient((String) k));
|
||||||
}
|
} else if (k instanceof ItemStack && !((ItemStack) k).isEmpty()) {
|
||||||
else if(k instanceof ItemStack && !((ItemStack)k).isEmpty()){
|
|
||||||
inputL.add(i, Ingredient.fromStacks((ItemStack) k));
|
inputL.add(i, Ingredient.fromStacks((ItemStack) k));
|
||||||
}
|
} else if (k instanceof Item) {
|
||||||
else if(k instanceof Item){
|
|
||||||
inputL.add(i, Ingredient.fromStacks(new ItemStack((Item) k)));
|
inputL.add(i, Ingredient.fromStacks(new ItemStack((Item) k)));
|
||||||
}
|
} else if (k instanceof Block) {
|
||||||
else if(k instanceof Block){
|
|
||||||
inputL.add(i, Ingredient.fromStacks(new ItemStack((Block) k)));
|
inputL.add(i, Ingredient.fromStacks(new ItemStack((Block) k)));
|
||||||
}
|
} else if (k instanceof Ingredient) {
|
||||||
else{
|
inputL.add(i, (Ingredient) k);
|
||||||
|
} else {
|
||||||
inputL.add(i, Ingredient.EMPTY);
|
inputL.add(i, Ingredient.EMPTY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,8 +207,7 @@ public final class RecipeHelper{
|
||||||
public static NonNullList<Ingredient> createInput(Object[] input) {
|
public static NonNullList<Ingredient> createInput(Object[] input) {
|
||||||
if (input[0] instanceof List) {
|
if (input[0] instanceof List) {
|
||||||
input = ((List<?>) input[0]).toArray();
|
input = ((List<?>) input[0]).toArray();
|
||||||
}
|
} else if (input[0] instanceof Object[]) {
|
||||||
else if(input[0] instanceof Object[]){
|
|
||||||
input = (Object[]) input[0];
|
input = (Object[]) input[0];
|
||||||
}
|
}
|
||||||
NonNullList<Ingredient> inputL = NonNullList.create();
|
NonNullList<Ingredient> inputL = NonNullList.create();
|
||||||
|
@ -235,19 +215,16 @@ public final class RecipeHelper{
|
||||||
Object k = input[i];
|
Object k = input[i];
|
||||||
if (k instanceof String) {
|
if (k instanceof String) {
|
||||||
inputL.add(i, new OreIngredient((String) k));
|
inputL.add(i, new OreIngredient((String) k));
|
||||||
}
|
} else if (k instanceof ItemStack) {
|
||||||
else if(k instanceof ItemStack){
|
|
||||||
inputL.add(i, Ingredient.fromStacks((ItemStack) k));
|
inputL.add(i, Ingredient.fromStacks((ItemStack) k));
|
||||||
}
|
} else if (k instanceof Item) {
|
||||||
else if(k instanceof Item){
|
|
||||||
inputL.add(i, Ingredient.fromStacks(new ItemStack((Item) k)));
|
inputL.add(i, Ingredient.fromStacks(new ItemStack((Item) k)));
|
||||||
}
|
} else if (k instanceof Block) {
|
||||||
else if(k instanceof Block){
|
|
||||||
inputL.add(i, Ingredient.fromStacks(new ItemStack((Block) k)));
|
inputL.add(i, Ingredient.fromStacks(new ItemStack((Block) k)));
|
||||||
}
|
} else if (k instanceof Ingredient) {
|
||||||
else{
|
inputL.add(i, (Ingredient) k);
|
||||||
throw new UnsupportedOperationException(
|
} else {
|
||||||
"Attempted to add invalid shapeless recipe. Complain to the author of "+MODNAME);
|
throw new UnsupportedOperationException("Attempted to add invalid shapeless recipe. Complain to the author of " + MODNAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return inputL;
|
return inputL;
|
||||||
|
|
Loading…
Reference in a new issue