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.

GodOfYeti

Members
  • Joined

  • Last visited

Everything posted by GodOfYeti

  1. How can I spawn in another block and make them mimic each other since it will have a gui
  2. Nah air would be like the energy
  3. Ok guys I was wondering how I could make a type of generator that makes air like a air conditioner
  4. How can I do the collision box then
  5. How can I set my custom techne model to have a 2 block tall block boundry
  6. ok and where would this type of code go, I'm sorry for all the questions I just want to get everything down
  7. Could you give me a piece of example code so I can better understand
  8. How would I go about doing it with meta data
  9. I have a custom block which rotates depending on players direction but sometimes it doesnt give a poop and rotates in the direction it wants and when it wants AngleVentPipe2.class @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) { if(entity == null){ return; } TileEntityAngleVentPipe2Block tile = (TileEntityAngleVentPipe2Block) world.getTileEntity(x,y,z); tile.direction = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360 / 4)); } TileEntityVentPipe2Block.class public int direction; TileEntityVentPipe2Renderer.class @Override public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float scale) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); ResourceLocation textures = (new ResourceLocation(RefStrings.MODID + ":textures/blocks/angleVentPipe2.png")); Minecraft.getMinecraft().renderEngine.bindTexture(textures); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); //Custom Rotate TileEntityAngleVentPipe2Block tile = (TileEntityAngleVentPipe2Block) entity; int direction = tile.direction; GL11.glRotatef(direction * 90 - 270, 0.0F, 1.0F, 0.0F); this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); }
  10. What would the center rotation point be
  11. Well I made this with techne so I cant go back to it because I didnt save and only exported as a java class
  12. Ok so I have a tile entity and everything but I was wondering how I can use the rf api
  13. anyone?
  14. Ok I need some help heres my rotation setup now and it rotates weird AngleVentPipe2.class @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) { if(entity == null){ return; } TileEntityAngleVentPipe2Block tile = (TileEntityAngleVentPipe2Block) world.getTileEntity(x,y,z); tile.direction = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360 / 4)); } TileEntityVentPipe2Block.class public int direction; TileEntityVentPipe2Renderer.class @Override public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float scale) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); ResourceLocation textures = (new ResourceLocation(RefStrings.MODID + ":textures/blocks/angleVentPipe2.png")); Minecraft.getMinecraft().renderEngine.bindTexture(textures); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); //Custom Rotate TileEntityAngleVentPipe2Block tile = (TileEntityAngleVentPipe2Block) entity; int direction = tile.direction; GL11.glRotatef(direction * 90 - 270, 0.0F, 1.0F, 0.0F); this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); }
  15. Would I put this in the model class itself seems like thats were it goes
  16. I actually need to rotate the block its a special model
  17. How can I rotate a block depending on player direction
  18. I keep getting a error under render heres the line this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); and heres the code package com.linumhost.TileEntity; import org.lwjgl.opengl.GL11; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; public class TileEntityServerCasetModel extends TileEntitySpecialRenderer { //The model of your block private final TileEntityServerCasetModel model; public TileEntityServerCasetModel() { this.model = new TileEntityServerCasetModel(); } private void adjustRotatePivotViaMeta(World world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); GL11.glPushMatrix(); GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F); GL11.glPopMatrix(); } @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { //The PushMatrix tells the renderer to "start" doing something. GL11.glPushMatrix(); //This is setting the initial location. GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); //This is the texture of your block. It's pathed to be the same place as your other blocks here. //Outdated bindTextureByName("/mods/roads/textures/blocks/TrafficLightPoleRed.png"); //Use in 1.6.2 this ResourceLocation textures = (new ResourceLocation("[yourmodidhere]:textures/blocks/TrafficLightPoleRed.png")); //the ':' is very important //binding the textures Minecraft.getMinecraft().renderEngine.bindTexture(textures); //This rotation part is very important! Without it, your model will render upside-down! And for some reason you DO need PushMatrix again! GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); //A reference to your Model file. Again, very important. this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); } //Set the lighting stuff, so it changes it's brightness properly. private void adjustLightFixture(World world, int i, int j, int k, Block block) { Tessellator tess = Tessellator.instance; //float brightness = block.getBlockBrightness(world, i, j, k); //As of MC 1.7+ block.getBlockBrightness() has become block.getLightValue(): float brightness = block.getLightValue(world, i, j, k); int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int modulousModifier = skyLight % 65536; int divModifier = skyLight / 65536; tess.setColorOpaque_F(brightness, brightness, brightness); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier); } }
  19. I dont know where to start thou
  20. How can I make a custom furnace and instead of using fuel use the redstoneflux api
  21. Well I ended up rewriting the entire block and it seems to be working but I would like to know how to make it rotate depending on the players location
  22. This is what I got so far package com.mcpixelplex.blocks; import com.mcpixelplex.CreativeTabs.BlessedCreativeTab; import com.mcpixelplex.lib.RefStrings; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class MachineBlock extends Block{ public MachineBlock(int id) { super(Material.iron); setBlockName("machineBlock"); setCreativeTab(BlessedCreativeTab.tabBlocks); setHardness(5F); setResistance(10F); } //public TileEntity createNewTileEntity(World world) { // return null; //} @SideOnly(Side.CLIENT) public static IIcon topIcon; @SideOnly(Side.CLIENT) public static IIcon sideIcon; @SideOnly(Side.CLIENT) public static IIcon frontIcon; @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister icon) { topIcon = icon.registerIcon(RefStrings.MODID + ":machineBlockTop"); //top sideIcon = icon.registerIcon(RefStrings.MODID + ":machineBlockSide"); //side frontIcon = icon.registerIcon(RefStrings.MODID + ":machineBlockFront"); //front } @Override public IIcon getIcon(int side, int meta) { if(side == 0 || side == 1) { return topIcon; } else if(side == 2) { return frontIcon; } else { return sideIcon; } } }
  23. Ive tried that
  24. Look guys im trying here but im getting no where

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.