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.

FatalEU

Members
  • Joined

  • Last visited

  1. Never mind everyone I did it; [/img] I added this into the ModEntity class; public ArrayList<ForgeDirection> directions = new ArrayList(); and in each of my tileentity classes I added directions public TileEntityContainer() { directions.add(ForgeDirection.DOWN); } then for the pipes I changed the shouldConnectTo function to take both the entity and the direction private boolean shouldConnectTo(TileEntity entity, ForgeDirection forgeDirection) { if(entity instanceof ModEntity && ((ModEntity) entity).directions.contains(forgeDirection)){ return true; } return false; }
  2. So I have a a class called Pipes that I have; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import com.fataleu.mod.helpers.ModEntity; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; public class TileEntityPipe extends ModEntity { public Map<ForgeDirection, TileEntity> getConnectedSides() { Map<ForgeDirection, TileEntity> connect = new HashMap<ForgeDirection, TileEntity>(); connect.put(ForgeDirection.WEST, getBlockTileEntity(xCoord + 1, yCoord, zCoord)); connect.put(ForgeDirection.EAST, getBlockTileEntity(xCoord - 1, yCoord, zCoord)); connect.put(ForgeDirection.UP, getBlockTileEntity(xCoord, yCoord + 1, zCoord)); connect.put(ForgeDirection.DOWN, getBlockTileEntity(xCoord, yCoord - 1, zCoord)); connect.put(ForgeDirection.NORTH, getBlockTileEntity(xCoord, yCoord, zCoord + 1)); connect.put(ForgeDirection.SOUTH, getBlockTileEntity(xCoord, yCoord, zCoord - 1)); Map<ForgeDirection, TileEntity> _Map = new HashMap<ForgeDirection, TileEntity>(); for (Map.Entry<ForgeDirection, TileEntity> entry : connect.entrySet()) { if (shouldConnectTo(entry.getValue())) { _Map .put(entry.getKey(), entry.getValue()); } } return _Map ; } private boolean shouldConnectTo(TileEntity entity) { if(entity instanceof ModEntity){ return true; } return false; } } This works good if you only want to connect to any side of a given entity but I want to have it so that you can only connect to certain sides depending on the entity. For instance a containerEntity would only connect at the top side but a pipe would bee all sides. Does anyone have any suggestions on how to go about this

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.