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.

toni714

Members
  • Joined

  • Last visited

Everything posted by toni714

  1. Hello, your problem is that the set default direction function works based on the surrounding blocks, not on you i had the same problem i left the on block added function out completely and added a function (in the block class) and call it in the on block placed by function like so: onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase, ItemStack p_149689_6_){ byte b0 = 3; b0=rotateBlock(b0, entity);//call my function world.setBlockMetadataWithNotify(i, j, k, b0, 2); } and here is the function: public byte rotateBlock(byte b0, EntityLivingBase entity){ if((entity.rotationYaw>=135&&entity.rotationYaw<=181)||(entity.rotationYaw<=-135&&entity.rotationYaw>=-181)){ //if entity is faceing north b0 = 3; }else if(entity.rotationYaw>-135&&entity.rotationYaw<-45){ //if entity is faceing east b0 = 4; }else if(entity.rotationYaw>=-45&&entity.rotationYaw<=45){ //if entity is faceing south b0 = 2; }else if(entity.rotationYaw>45&&entity.rotationYaw<135){ //if entity is faceing west b0 = 5; //sometimes rotationYaw gets over 180 or under -180 //for example 185 equals the rotation at -175 //so im fixing that by subtracting 360 if it is over 180 or under -180 }else if(entity.rotationYaw>=181){ entity.rotationYaw=entity.rotationYaw-360; b0=rotateBlock(b0, entity); }else if(entity.rotationYaw<=-181){ entity.rotationYaw=entity.rotationYaw+360; b0=rotateBlock(b0, entity); } return b0; } i hope that helps 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.