Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

st4s1k

Members
  • Joined

  • Last visited

Everything posted by st4s1k

  1. Ok, I see I annoy you, maybe I'll try to figure it out for myself.
  2. is this: AxusAlignedBB Sandbbox = new AxisAlignedBB(i, j, k, (float)i + 1, (float)j + 1, (float)k + 1); a good replacement for this: AxisAlignedBB Sandbbox = AxisAlignedBB.getBoundingBox(i, j, k, (float)i + 1, (float)j + 1, (float)k + 1); ?
  3. I'm not 100% sure that I can make this mod work. But this is sort of a challenge for me. I really want to try as hard as I can, with somebody's help of course, if they will.
  4. Something like this?: EnumFacing orient = par1block.getDefaultState().getValue(BlockDirectional.FACING);
  5. Ok, I found the answer, ty: public static boolean canmove(final xWorld world, final int i, final int j, final int k, final BlockPistonBase par1block) { EnumFacing orient = BlockPistonBase.getFacing(world.getBlockMetadata(i, j, k)); final int i2 = i + Facing.offsetsXForSide[orient]; final int j2 = j + Facing.offsetsYForSide[orient]; final int k2 = k + orient.getFrontOffsetZ();
  6. I checked IBlockState and interfaces it extends IBlockBehaviors and IBlockProperties, and there is no mentioning of EnumFacing whatsoever.
  7. No I don't know how ASM works. What should I stop, and why "please" ? I can stop asking for help if this is what you want.
  8. Trying to replace Facing with EnumFacing. Unfortunately it is not a Forge class, so there is no mentioning about it anywhere really. Do you know which function should be used instead? Only on some strange site: https://www.programcreek.com/java-api-examples/index.php@source_dir=flex-blazeds-master/modules/core/src/flex/messaging/cluster/?class=net.minecraft.util.Facing&method=offsetsZForSide
  9. I have some problems with converting TileEntityPiston constructor, can somebody help me?: for (int i = par5; i > 1; i--) { final int xxf = xx - Facing.offsetsXForSide[par6]; final int yyf = yy - Facing.offsetsYForSide[par6]; final int zzf = zz - Facing.offsetsZForSide[par6]; final ResourceLocation var12 = Block.REGISTRY.getNameForObject(par1World.getBlock(xxf, yyf, zzf)); int var13 = par1World.getBlockMetadata(xxf, yyf, zzf); final int bpmeta = BlockPhysics.getBlockBPdata(par1World, xxf, yyf, zzf); final Block bb = Block.REGISTRY.getObject(var12); if ( bb == Blocks.PISTON || bb == Blocks.STICKY_PISTON ) { var13 = var13 & 7; } final TileEntityPiston tePiston = new TileEntityPiston(bb, var13, par6, true, false); final TileEntityPiston tePiston = new TileEntityPiston( par1World.getBlockState(new BlockPos(xxf, yyf, zzf)), pistonFacingIn, /* I don't know where to get this value */ true, false ); // ... }
  10. I noticed that World.playSound method is empty: public void playSound(double x, double y, double z, SoundEvent soundIn, SoundCategory category, float volume, float pitch, boolean distanceDelay) { } Do you know why is that? I'm trying to replace this method: xworld.playSoundEffect(i + 0.5F, j + 0.5F, k + 0.5F, block.stepSound.getBreakSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
  11. Thanks You're right. I don't have any conflict because all methods are used inside the same class.
  12. Do you know what is the alternative to " Items.redstone " ?
  13. Well this method and class are located in the same class: public class BlockPhysics Also xWorld extends World and World objects can be assigned to xWorld objects without conflict, if understand you correctly.
  14. Is it in general a bad practice? Will it affect the performance? Should I just start a new project and try to implement the logic from the old mod into the new mod, based on new version of forge?
  15. Actually, I have changed all "World" (case sensitive) occurrences to xWorld (custom), in the *.java file I'm editing now. Using find and replace. Also I took care of imports, because it got changed too, so I changed it back. for example: public static boolean setBlockBPdata( final xWorld world, final int par1, final int par2, final int par3, final int par4 ) { if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000) { if (par2 < 0) { return false; } else if (par2 >= 256) { return false; } else { final Chunk chunk = world.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); final int j1 = par1 & 15; final int k1 = par3 & 15; return (Boolean) BlockPhysics.asmHelper.invoke(chunk, "setBlockBPdata", j1, par2, k1, par4); } } else { return false; } }
  16. It's just a wrapping class which maps old methods to the new ones.
  17. Currently I'm "porting" in e very primitive way: class xWorld extends World { protected xWorld(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client) { super(saveHandlerIn, info, providerIn, profilerIn, client); } public boolean setBlock(int x, int y, int z, Block block, int meta, int flags) { BlockPos blockPos = new BlockPos(x, y, z); return setBlockState( blockPos, block.getDefaultState(), flags ); } public Block getBlock(int x, int y, int z) { return getBlockState(new BlockPos(x, y, z)).getBlock(); } public int getBlockMetadata(int x, int y, int z) { return getBlock(x, y, z).getMetaFromState(getBlockState(new BlockPos(x, y, z))); } public TileEntity getTileEntity(int x, int y, int z) { return super.getTileEntity(new BlockPos(x, y, z)); } public void removeTileEntity(int x, int y, int z) { super.removeTileEntity(new BlockPos(x, y, z)); } @Override protected IChunkProvider createChunkProvider() { return this.createChunkProvider(); } @Override protected boolean isChunkLoaded(int x, int z, boolean allowEmpty) { return this.isChunkLoaded(x, z, allowEmpty); } } What do you think?
  18. Is StateID and Meta the same thing?
  19. Do you know, how can I replace this deprecated method? if ( par1Block.getRenderType() == 18) { Also, you said that : Where can I get informed more about rendering? There is a datatype that I cannot find replacement to: RenderBlocks
  20. So the problem is not solved...))
  21. Looks like many people are interested in this mod. This is a really nice mod) https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/mods-discussion/2312201-block-physics-mod
  22. Nope... It looks like it's a scam... https://www.minecraftresource.com/block-physics-mod/ Hate pages like this
  23. Yes, it seems like there are some similar mods, not sure that they are completely the same, but maybe something that will satisfy me, because I just wanted a block physics mod for my server =D Thank you!
  24. Also an error: Inconvertible types; cannot cast 'net.minecraft.entity.item.EntityFallingBlock' to 'net.minecraft.entity.item.EntityTNTPrimed'
  25. Hi, my name is Stanislav. I'm new to modding, but I'm familiar with Java (a little bit, to be objective). This is my first encounter with modding to be fair. I am trying to port a very old mod called BlockPhysics from version 1.6.2 to version 1.12. I know it is tricky and hard, but I want to try anyway, because the creator seems to quit modding. Here is the mod on github: https://github.com/vidplace7/BlockPhysics There was about 1000 errors in a class file that I'm trying to repair now, and now there are about 500, so there is some (small) progress x) There are many fields/methods or even data-types in the old forge/minecraft that are missing int the new versions of this two. Here are some of them: EntityTracker#movingblocks // no such field World#setBlock() // no such method Facing // no such class EntityfallingBlock#bpdata // no such field in this class EntityfallingBlock#slideDir // no such field in this class Block#getOrientation(int) // no such method Block#isIndirectlyPowered(World, int, int, int, int) // no such method ItemStack#stackSize // no such field Item#redstone // no such field Explosion#explosionSize // no such field EnchantmentProtection#func_92092_a(Entity, double) // some obfuscated method (from github: https://github.com/vidplace7/BlockPhysics/blob/master/src/blockphysics/BlockPhysics.java) ExtendedBlockStorage#getExtBlockID() // no such method ExtendedBlockStorage#getExtBlockMetadata() // no such method World#moveTickList // no such field Maybe you could help me. I would appreciate it very much. I figured out some minor issues, like "Block.grass" should be changed to "Blocks.GRASS", or method names have changed, I always check for similar methods, or instead of coordinates a method may ask for BlockPos, those are not a big deal. Thank you.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.