-
Posts
12 -
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.
Artsicle's Achievements
Tree Puncher (2/8)
3
Reputation
-
Oh, thanks
-
With my new tile entity, my nbt isnt importing when reloading the world, and all of the nbt data is being shared across all the blocks. Also it said something like "Tile Entity is missing a mapping!" before I added the auto inserter register. That makes sense, however the NBT is still not working for the auto inserter but it is for the extractor (Using 1.12.2) GameRegistry.registerTileEntity(TileEntityExtractor.class, Reference.MOD_ID + "TileEntityExtractor"); GameRegistry.registerTileEntity(TileEntityAutoInserter.class, Reference.MOD_ID + "TileEntityAutoInserter"); http://prntscr.com/gqxlsm public class TileEntityAutoInserter extends TileEntity { static int redstoneCount; static int OreCount; @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { compound.setInteger("OreCount", OreCount); compound.setInteger("Count", redstoneCount); return super.writeToNBT(compound); } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); OreCount = compound.getInteger("OreCount"); redstoneCount = compound.getInteger("redstoneCount"); } Also, I'm doing @Nullable @Override public TileEntity createNewTileEntity( World worldIn , int meta ) { return new TileEntityAutoInserter(); } From BlockAutoInserter.java
-
Would I do it sort of like this? container.getCapability(Capability<IItemHandler.class>,EnumFacing.NORTH); EDIT: Found it. itemhandler = container.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.NORTH);
-
But what do I do after? TileEntity container = worldIn.getTileEntity(po);
-
Artsicle changed their profile photo
-
Well that's the container.
-
I've been trying to add an item to a chest, but I dont know exactly how to do it. if(worldIn.getBlockState(po).getBlock() == Blocks.CHEST) { Block chest = worldIn.getBlockState(po).getBlock(); chest. } That's my code, the chest. is there from me trying to find something from auto complete but I don't know what to do. If anyone knows please reply! Thanks!
-
[1.10.2] Spawning Particles in Front of the Player?
Artsicle replied to Differentiation's topic in Modder Support
Try getting the players look vector so you can then change the velocity of the particles- 1 reply
-
- 1
-
1.12 (This is a stupid question, probably anyone can answer it)
Artsicle replied to Artsicle's topic in Modder Support
Fixed it! No need to help anymore -
I've been trying to get my block to accept redstone. I already have this @Override public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { return true; } But I don't know how to get if it's actually getting power, and what level of power it is. Tried this @Override public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { if(super.getWeakPower(blockState, blockAccess, pos, side) >=1) { powered = true; } else { powered = false; } return super.getWeakPower(blockState, blockAccess, pos, side); } but it didnt work, and minecraft doesnt have a default "Powered" blockstate property if you were gonna suggest that, unless its named strangely then do suggest it. Thanks!
-
1.12 Make block face the direction i'm facing
Artsicle replied to Artsicle's topic in Modder Support
Thanks, I got it! (For those who want to know, here is the code) @Override public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand).withProperty(FACING, placer.getHorizontalFacing()); } -
I know how to do this in 1.10 I think but /*@Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { super.onBlockPlacedBy(worldIn, pos, state, placer, stack); }*/ I'm not used to that method ^ I'm used to /*@Override public IBlockState onBlockPlaced*/ but that's not in 1.12. I tried doing super.onBlockPlacedBy(worldIn, pos, state.withProperty(FACING, placer.getHorizontalFacing()), placer, stack); But that didnt work. If anyone knows please reply.