Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Help with porting BlockPhysics mod from 1.6.2 to 1.12.
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 2
st4s1k

Help with porting BlockPhysics mod from 1.6.2 to 1.12.

By st4s1k, December 26, 2018 in Modder Support

  • Start new topic
  • Prev
  • 1
  • 2
  • 3
  • Next
  • Page 2 of 3  

Recommended Posts

diesieben07    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56382 posts
Posted December 27, 2018
2 minutes ago, st4s1k said:

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?

The method does nothing on the server, it is overridden in WorldClient. A detailed explanation of the various sound-related methods can be found in the documentation.

  • Like 1

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018 (edited)

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
   );

   // ...

}
Edited December 27, 2018 by st4s1k

Share this post


Link to post
Share on other sites

loordgek    176

loordgek

loordgek    176

  • World Shaper
  • loordgek
  • Members
  • 176
  • 1826 posts
Posted December 27, 2018

you get the facing form the blockstate

 

but something else, BlockPhysics is using a lot of ASM hacks.

do you know how ASM works if not please stop.

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018 (edited)

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?

image.png.b2496e185054462dff27551bbf3f9242.png

 

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

Edited December 27, 2018 by st4s1k

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018
31 minutes ago, loordgek said:

you get the facing form the blockstate

 

but something else, BlockPhysics is using a lot of ASM hacks.

do you know how ASM works if not please stop.

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.

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018
35 minutes ago, loordgek said:

you get the facing form the blockstate

I checked IBlockState and interfaces it extends IBlockBehaviors and IBlockProperties, and there is no mentioning of EnumFacing whatsoever.

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018

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();

Share this post


Link to post
Share on other sites

loordgek    176

loordgek

loordgek    176

  • World Shaper
  • loordgek
  • Members
  • 176
  • 1826 posts
Posted December 27, 2018

 

29 minutes ago, st4s1k said:

EnumFacing orient = BlockPistonBase.getFacing(world.getBlockMetadata(i, j, k));

that works but that is not the normal way

 

you should do it like so

EnumFacing orient = state.getValue(BlockDirectional.FACING);

 

  • Like 1

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018
13 minutes ago, loordgek said:

 

that works but that is not the normal way

 

you should do it like so


EnumFacing orient = state.getValue(BlockDirectional.FACING);

 

Something like this?:

EnumFacing orient = par1block.getDefaultState().getValue(BlockDirectional.FACING);

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018

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.

Share this post


Link to post
Share on other sites

loordgek    176

loordgek

loordgek    176

  • World Shaper
  • loordgek
  • Members
  • 176
  • 1826 posts
Posted December 27, 2018

 

no that will return null

 

EnumFacing orient = state.getValue(BlockDirectional.FACING);

and you can get the state for world.getBlockStae

  • Like 1

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018 (edited)

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);

?

Edited December 27, 2018 by st4s1k

Share this post


Link to post
Share on other sites

loordgek    176

loordgek

loordgek    176

  • World Shaper
  • loordgek
  • Members
  • 176
  • 1826 posts
Posted December 27, 2018

yes

 

stop. you have no idea what you are doing

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018

Ok, I see I annoy you, maybe I'll try to figure it out for myself.

Share this post


Link to post
Share on other sites

loordgek    176

loordgek

loordgek    176

  • World Shaper
  • loordgek
  • Members
  • 176
  • 1826 posts
Posted December 27, 2018

no you are not annoying me

i am trying to help you

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018 (edited)
10 minutes ago, loordgek said:

no you are not annoying me

i am trying to help you

I appreciate your responses, but telling me that I should stop doesn't really help =D


Maybe my questions may sound silly, idk, I've never been modding before, neither am I doing now. I'm trying to make an old minecraft mod working using my level of Java knowledge. I'm just exploring and I enjoy it. If I enjoy it, why should I simply stop. Or maybe you can give me an alternative starting point?

Edited December 27, 2018 by st4s1k

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018

I had around 1k errors in the code I'm fixing now. Now it's around 300, and every day I'm making a little progress, small steps, but better than yesterday, and I think that's good.

Share this post


Link to post
Share on other sites

loordgek    176

loordgek

loordgek    176

  • World Shaper
  • loordgek
  • Members
  • 176
  • 1826 posts
Posted December 27, 2018

i can make a new mod for you

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018
3 minutes ago, loordgek said:

i can make a new mod for you

=D That sounds very generous of you. I don't think you want to waste your time on somebody else's problems...)

Share this post


Link to post
Share on other sites

loordgek    176

loordgek

loordgek    176

  • World Shaper
  • loordgek
  • Members
  • 176
  • 1826 posts
Posted December 27, 2018

do you have discord ??

 

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018
5 minutes ago, loordgek said:

do you have discord ??

 

yes

Share this post


Link to post
Share on other sites

loordgek    176

loordgek

loordgek    176

  • World Shaper
  • loordgek
  • Members
  • 176
  • 1826 posts
Posted December 27, 2018

can have your name so we can DM

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 27, 2018
2 minutes ago, loordgek said:

can have your name so we can DM

st4s1k#7446

Share this post


Link to post
Share on other sites

Cadiboo    365

Cadiboo

Cadiboo    365

  • Reality Controller
  • Cadiboo
  • Members
  • 365
  • 3624 posts
Posted December 28, 2018
11 hours ago, loordgek said:

do you know how ASM works if not please stop.

Stop even if you do know how it works

You should start from scratch & then bring some of the old code in once you have good understanding of modding.

I've just ported a very rendering intensive mod from 1.7.10 -> 1.12.2 and I'm a little experienced in it (world rendering particularly) so pm me on discord if you have any questions @Cadiboo#8887


About Me

Spoiler

My Discord - Cadiboo#8887

My Website - Cadiboo.github.io

My Mods - Cadiboo.github.io/projects

My Tutorials - Cadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Share this post


Link to post
Share on other sites

st4s1k    0

st4s1k

st4s1k    0

  • Stone Miner
  • st4s1k
  • Members
  • 0
  • 50 posts
Posted December 28, 2018 (edited)
34 minutes ago, Cadiboo said:

You should start from scratch & then bring some of the old code in once you have good understanding of modding.

I guess this is what I am going to do. Do you have any advice, that would ease my learning trip? Aside referring to FORGEdocs , because it seems to be superficial.

All it has about rendering is this small paragraph:
https://mcforge.readthedocs.io/en/latest/rendering/teisr/

 

I mean, there is a giant library of minecraft & forge classes, but very little documentation. How can I possibly learn something meaningful? By guessing?

Edited December 28, 2018 by st4s1k

Share this post


Link to post
Share on other sites
  • Prev
  • 1
  • 2
  • 3
  • Next
  • Page 2 of 3  
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 2
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Varzac
      Forge jar file not opening

      By Varzac · Posted 4 minutes ago

      I ran Jarfix and then tried installing again with the same results. Nothing happening I even tried using winrar, but as you said nothing happened
    • BeardlessBrady
      [1.16.4] Null when OpenGUI

      By BeardlessBrady · Posted 9 minutes ago

      Ah.. Thats what I get for stopping half way through and not double checking, thanks!
    • poopoodice
      [1.16.4] Null when OpenGUI

      By poopoodice · Posted 24 minutes ago

      https://github.com/Beardlessbrady/Currency-Mod/blob/master-1.16/src/main/java/com/beardlessbrady/gocurrency/blocks/vending/VendingTile.java#L68 This should not be null.
    • -MCS_Gaming-
      Matchmaking System?

      By -MCS_Gaming- · Posted 26 minutes ago

      I'm making an fps style mod and want to implement a matchmaking system, but I have absolutely no idea where to begin. Would anyone be able to give me some pointers as to how I would go about doing this?
    • BeardlessBrady
      [1.16.4] Null when OpenGUI

      By BeardlessBrady · Posted 49 minutes ago

      While trying to open a gui in my block my console returns with this error: https://pastebin.com/XNYzf9pe Its basically saying that something is null on line 51. I am checking if namedContainerProvider is null and its doubtful the player is null so that means the NetworkHooks is returning null? How does one fix that issue.   Below is a link to the line the error is referring to: https://github.com/Beardlessbrady/Currency-Mod/blob/master-1.16/src/main/java/com/beardlessbrady/gocurrency/blocks/vending/VendingBlock.java#L51
  • Topics

    • Varzac
      3
      Forge jar file not opening

      By Varzac
      Started 12 hours ago

    • BeardlessBrady
      2
      [1.16.4] Null when OpenGUI

      By BeardlessBrady
      Started 49 minutes ago

    • -MCS_Gaming-
      0
      Matchmaking System?

      By -MCS_Gaming-
      Started 26 minutes ago

    • Nyko
      1
      [1.16.5] Beacon Overwrite (Screen Error)

      By Nyko
      Started 15 hours ago

    • ThisIsNotOriginal
      0
      Error at load_registries event phase

      By ThisIsNotOriginal
      Started 1 hour ago

  • Who's Online (See full list)

    • JackRaidenPH
    • -MCS_Gaming-
    • AiresNor
    • Draco18s
    • BeardlessBrady
    • Varzac
    • Top_DawgsPM
    • Talp1
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Help with porting BlockPhysics mod from 1.6.2 to 1.12.
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community