Everything posted by GodOfYeti
-
block boundry
How can I spawn in another block and make them mimic each other since it will have a gui
-
Making a generator
Nah air would be like the energy
-
Making a generator
Ok guys I was wondering how I could make a type of generator that makes air like a air conditioner
-
block boundry
How can I do the collision box then
-
block boundry
How can I set my custom techne model to have a 2 block tall block boundry
-
Custom block does what it wants
ok and where would this type of code go, I'm sorry for all the questions I just want to get everything down
-
Custom block does what it wants
Could you give me a piece of example code so I can better understand
-
Custom block does what it wants
How would I go about doing it with meta data
-
Custom block does what it wants
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(); }
-
Rotate Block
What would the center rotation point be
-
Rotate Block
Well I made this with techne so I cant go back to it because I didnt save and only exported as a java class
-
How to use rf api
Ok so I have a tile entity and everything but I was wondering how I can use the rf api
- Rotate Block
-
Rotate Block
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(); }
-
Rotate Block
Would I put this in the model class itself seems like thats were it goes
-
Rotate Block
I actually need to rotate the block its a special model
-
Rotate Block
How can I rotate a block depending on player direction
- TileEntityModel help
-
TileEntityModel help
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); } }
-
Custom Furnace
I dont know where to start thou
-
Custom Furnace
How can I make a custom furnace and instead of using fuel use the redstoneflux api
-
Icon not rendering
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
-
Icon not rendering
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; } } }
-
Icon not rendering
Ive tried that
-
Icon not rendering
Look guys im trying here but im getting no where
IPS spam blocked by CleanTalk.