Jump to content

cj3636

Members
  • Posts

    14
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

cj3636's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Check out BlockGlass in vanilla code. Check out BlockPane in vanilla code. I have had similar issues with partial blocks due to the way minecraft renders them vs a simple translucent/transparent block. A glass pane is both see-through and a partial block, so if it can be done in vanilla you should be able to easily steal some vanilla methods and get it working, but be sure to override vanilla wherever possible. I should add that removing some of the vanilla transparent/partial block related methods may be how you have to do it, since vanilla renders entities through glass now.
  2. I touched up the code a bit. I still have the same issue and for the life of can not figure out why! The block receives energy just fine, but refuses to send it. Relevant code in my repo on GitHub. Thank you for your help so far!
  3. I'm not 100% sure, but the tutorial explained it was necessary to convince other power api's that the block was Forge Energy compatible?
  4. ^ You allocated 7Gb out of your 8Gb. The game will not load like that.
  5. 1.12.2 This is the code I have gotten to now: TileEntity EnergyStorage ForgeWrapper I was following CjMinecraft's tutorial seen here on GitHub Still have the same issue; the block will connect to RF, receive RF, but refuses to send it.
  6. I am using Redstone Flux (Thermal Expansion) for testing. Currently, my block will connect to fluxducts and accepts energy (tested with simpleSystem.out, it even saves it on reload), but refuses to send energy into a cable, machine or otherwise. Here is the TileEnity/block/EnergyStorage and ForgeWrapper for my custom energy implementation.
  7. How to create a custom Crafting Inventory with custom Recipes in 1.12.2? I have a got a sort of custom crafting table. As of right now, it essentially is a copy of the Vanilla Workbench. I want it to have custom recipes, but I can not seem to figure it out since the whole json recipe change. Can some one give me some guidance on this? Here is the relevant classes on Github. The ones most recently updated are the only ones currently in use, the rest is old garbage.
  8. Her is how I use in an item. It shoots the player in the direction they are looking: @Override protected void onCtrlRight(World worldIn, EntityPlayer playerIn, ItemStack stack) { Vec3d lookVec = playerIn.getLookVec(); double x = lookVec.xCoord; double y = lookVec.yCoord; double z = lookVec.zCoord; playerIn.setVelocity(x * 10, y, z * 10); stack.damageItem(1, playerIn); }
  9. To be more specific, I have a special in-world crafting that currently uses a List<ItemStack> of size 4 (in, in, in, out). I want for people to be able to register new recipes in a fashion similar to the built-in Forge mechanic. Do I have to make a new IRecipe implementation? I dislike IRecipe because I find it overly complicated.
  10. Any idea how to accomplish this without using a GUI?
  11. The pillar does not work at all when the variables are not set to static.
  12. Do you know the name of the block?
  13. Context: I have a 'pillar' sort of block. The player can right click it with an item/block and the item will placed for display on top of the block. The player can then remove the item by right clicking again with an empty hand. This works almost exactly like the jukebox only with the additional rendering of EntityItem on top of the block. The problem: Two or more Pillar blocks do not uniquely hold items. An item can be placed on the first pillar... once an item is placed on the second pillar, the first item is deleted (it stays rendered, but cannot be recovered) and the second item becomes the only one in existence. This continues for each additional pillar. I have tried everything to fix this issue and can not seem to figure it out. The tile entity is properly registered in the Common Proxy. The Block: public class ArcanePillarBlock extends BlockContainer { public static final PropertyBool HAS_DISPLAY = PropertyBool.create("has_display"); public ArcanePillarBlock(String unlocalizedName, Material material, float hardness, float resistance) { super(material); this.setDefaultState(this.blockState.getBaseState().withProperty(HAS_DISPLAY, Boolean.valueOf(false))); this.setCreativeTab(Ref.CTAB); this.setUnlocalizedName(unlocalizedName); this.setRegistryName(unlocalizedName); this.setHardness(hardness); this.setResistance(resistance); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (state.getValue(HAS_DISPLAY).booleanValue()) { dropRecord(worldIn, pos, state, playerIn.getPosition()); } else if (heldItem != null) { insertRecord(worldIn, pos, state, heldItem); if (!playerIn.capabilities.isCreativeMode) { heldItem.stackSize--; } } return true; } public void insertRecord(World worldIn, BlockPos pos, IBlockState state, ItemStack heldItem) { if (!worldIn.isRemote) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof ArcanePillarTileEntity) { ArcanePillarTileEntity arcaneTileEntity = (ArcanePillarTileEntity) tileentity; worldIn.setBlockState(pos, state.withProperty(HAS_DISPLAY, Boolean.valueOf(true)), 2); arcaneTileEntity.setDisplay(heldItem.copy()); } } } private void dropRecord(World worldIn, BlockPos pos, IBlockState state, BlockPos spawnPos) { if (!worldIn.isRemote) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof ArcanePillarTileEntity) { ArcanePillarTileEntity arcaneTileEntity = (ArcanePillarTileEntity) tileentity; ItemStack itemstack = arcaneTileEntity.getDisplay(); if (itemstack != null) { arcaneTileEntity.setDisplay((ItemStack) null); arcaneTileEntity.endDisplay(); ItemStack itemstack1 = itemstack.copy(); itemstack1.stackSize = 1; EntityItem entityitem = new EntityItem(worldIn, spawnPos.getX(), spawnPos.getY(), spawnPos.getZ(), itemstack1); entityitem.setDefaultPickupDelay(); worldIn.setBlockState(pos, state.withProperty(HAS_DISPLAY, Boolean.valueOf(false)), 2); worldIn.spawnEntityInWorld(entityitem); } } } } @Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { dropRecord(worldIn, pos, state, pos); super.breakBlock(worldIn, pos, state); } @Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(HAS_DISPLAY, Boolean.valueOf(meta > 0)); } @Override public int getMetaFromState(IBlockState state) { return ((Boolean) state.getValue(HAS_DISPLAY)).booleanValue() ? 1 : 0; } @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[]{HAS_DISPLAY}); } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new ArcanePillarTileEntity(); } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.MODEL; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public boolean isFullCube(IBlockState state) { return false; } @Override @SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.TRANSLUCENT; } @Override @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { return true; } The Tile Entity: public class ArcanePillarTileEntity extends TileEntity { private static ItemStack displayItem; private static EntityItem displayEntity; public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); if (compound.hasKey("DisplayItem", 10)) { this.setDisplay(ItemStack.loadItemStackFromNBT(compound.getCompoundTag("DisplayItem"))); } else if (compound.getInteger("DisplayItem") > 0) { this.setDisplay(new ItemStack(Item.getItemById(compound.getInteger("Item")))); } } public NBTTagCompound writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); if (getDisplay() != null) { compound.setTag("DisplayItem", getDisplay().writeToNBT(new NBTTagCompound())); } return compound; } @Nullable public ItemStack getDisplay() { System.out.println(this); return this.displayItem; } public void setDisplay(@Nullable ItemStack itemStack) { this.displayItem = itemStack; if (itemStack != null) { ItemStack tempStack = new ItemStack(this.displayItem.getItem(), 1); this.displayEntity = new EntityItem(worldObj, pos.getX() + .5, pos.getY() + 1, pos.getZ() + .5, tempStack); this.displayEntity.setInfinitePickupDelay(); this.displayEntity.setNoDespawn(); this.displayEntity.setVelocity(0D, 0D, 0D); if (!worldObj.isRemote) { worldObj.spawnEntityInWorld(displayEntity); } } this.markDirty(); } public void endDisplay() { this.displayEntity.setDead(); this.displayItem = null; this.markDirty(); } } Does anyone know of either a solution to my issue or possibly a better way to make an item display block? Thanks for any help you can offer! My GitHub with the rest of my code.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.