-
Posts
1511 -
Joined
-
Last visited
Posts posted by hydroflame
-
-
ah AH
RenderingRegistry.registerEntityRenderingHandler(EntityDireWolf.class, new RenderDireWolf(new ModelDireWolf(), 1.0f));
this should be in a client proxy, as the constructor "new ModelDireWolf()" is called server side in this case.
so remove everythign "rendering" related from main mod and put it in the client proxy (most likely in the method "registerRenders", just remember to also call the method, like commonProxy.registerRenderers())
in CommonProxy:
public void registerRenderers(){
//empty
}
in client proxy:
public void registerRenderers(){
RenderingRegistry.registerEntityRenderingHandler(EntityDireWolf.class, new RenderDireWolf(new ModelDireWolf(), 1.0f));
//and extra stuff related
}
in main mod class:
public void load( FMLsomethingEvent event){
commonProxy.registerRenderers();
}
also, nice code btw, clean and all, i like it
-
i mean the class and event of decoration, just look at the javadoc it's pretty straightfoward
-
no no, keep it as modelbase, im pretty sure this work since a lot of people are using it that way (mo's creature as example)
it said that the import you suggested doesn't existit being eclipse ? (that b*tch)
can you put in
sploier
your main mod class, model class, proxies class and wolf mob thigny class ?
-
does that return 0 all the time ?
if you want to generate after the land, use decorators instead.
-
this is just speculation as i have never worked with models yet.
but if you have to add @SideOnly(Side.CLIENT) you would only need to put it the line above public class yourclassname{} as it would say to forge that the whole class is client only
but then again that might not help
make sure that the only place there you have
import Modelwtv;
is in files that are only used by the client
-
yeah, well the server shouldnt care about the model of the wolf (or any visual aspect of a mob) so basicly make sure that NO server file need to look/import the model
-
you could always just make a loop
public int getHighestBlock(world, x, z){ for(int i = 128; i > 0; i--){ if(world.getBlockId(x, i, z) != 0){ return i; } return 0; } }
if it return 0 all the time it means your code is running BEFORE the land is generated
-
because for me in my block class
@Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int a, float b, float c, float d) { world.createExplosion(null, x, y, z, 5, true); return true; }
this works perfectly
-
It just doesn't work for me.
yo fresh my mod doesnt work fix it!
no srly if you want us to help, explain whats happening, is there just straight up nothing happening.
i noticed that my version of "onBlockActivate" has way more parameter. maybe its just cuz they changed it (im still in 151) but i doubt thats the case
is there any error coming up.
-
I'm wondering how you get the y coordinate that is not underground
heu ... y coordinate of what ?
because technicly yes 0 is a y coordinate.
are you asking how to get the y coordinate of the first block starting from the sky ? aka the non-air block that has the highest Y for a given x, z ?
-
@OP can i at least be quoted properly ?, specially if you're making a whole new thread for this.
-
change modifier of blockMetadata to static
yeah sorry i didnt actually compiled the code, i tought you would understand what i meant
to render in inventory you have to make a class that implements IItemRenderer and render when the ItemRenderType is of INVENTORY_BLOCK
look at the javadoc and the actual class its pretty straightfoward
-
which is obliviously not necessary but ok, hf
-
no, in the minecraft hierarchy, "entity" is above mob which is itself a "entityLiving"
i am honestly not sure how to spawn entities but im sure it would be a good idea to use them
to give a good example. the waypoints in rei minimap, visually are "entity" not mob or entity living.
look at the wiki you could probably find something about it.
if you cant find anything, the only other help I can give you is to wait until I need to use them in my mod, which should be soon enough but i can't give any precise ETA
-hydroflame-
-
Hey there, welcome to forge, hope you wont be leaving soon
1
client side:
Minecraft.getMinecraft().objectMouseOver
this contains whatever the player is pointing at
(oh btw i shouldnt told you, here in forge you have to deal with client/server side, but the advantage are worth it)
2 how to move blocks, well for the tornado i can imagine that the tornado itself is an "entity" (which btw with forge you can create your own) i guess it has a random chance to set a block to air and "pick up" the block (using entity rendering, you would render the block floating in the air but it probably wouldnt be collidable)
3 honestly the tutorial about metadata is pretty complete, try to play around with it and you should figure it out easy
ps: the tutorial will teach you a lot. try to look there first if you have a question because usually you can find the answer
-hydroflame, FRev-
-
client side
Minecraft.getMinecraft().objectMouseOver
is whatever the cursor is currently pointing at
-
no actually drawing a entity would be easier. just because its less code in general.
drawing a red "outline" over each cube affected would actually be a huge pain in the arse
-hydroflame-
-
package mar21.omega.machine.tileEntity.render;
import mar21.omega.machine.MachinePoweredMelter;
import mar21.omega.mar21.Mar21Extender;
import net.minecraft.block.Block;
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.world.World;
import org.lwjgl.opengl.GL11;
public class TileEntityPoweredMelterRender extends TileEntitySpecialRenderer {
//The model of your block
private final powered_melter model;
public TileEntityPoweredMelterRender() {
this.model = new powered_melter();
}
//you dont need this function
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.
bindTextureByName(Mar21Extender.getRenderedTexture("powered_melter"));
//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);
//This rotation part is making the model rotated as well!
//i think you can do this
side = te.blockMetadata;
//and adjust the rotation after
if(side == 0){GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);}
if(side == 1){GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);}
if(side == 2){GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);}
if(side == 3){GL11.glRotatef(90F, 0.0F, 1.0F, 0.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);
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);
}
}
-
massive object creation
yeah, using memory
-
I'm not that new to programming.
i wasn't necessarily referring to you, sorry
Tile Entity are basically extra information about a block, for example, sign have a tile entity that contains the text they are suppose to show
,beacon block contains information about their state (on off) and which buff they are giving
it is important to note that you cant place tile entities on block that dont support them, aka dirt, stone air, flower etc, etc
in my case i am using a new block called the plotblock. its tile entity contains the information about the width/height/length of the plot, this way i can use these information to draw a frame to visualize what are the limits that the plot owner can build in (as well as extra information like the cost of the plot etc etc)
the difference between using TE (tile entities) and entities is that tile entities are tied to a bloc. while entities are free to be placed anywhere.
you could technicly make an invisible entity that has information about the width/height/length of the protected area and x, y,z and use this entity to draw a big box that represents the limit of the area.
for TE they're are good tutorial on the wiki about how why when to use them. as for entitiy i am not sure as i am not using them (yet).
@redria7, ahaha, sorry , but you understand what i mean?
-
yes, except if you have to render your block before you pull the matrix (ill spare you the details)
but technicly
pushMatrix rotate draw popMatrix
bellow will not work
pushMatrix rotate popMatrix draw
-
you have to go out with a bang like:
hey i made this its new its fresh nobody has done thsi before.
unless you're doign somethign dull like "obsidian tools" generally people will like what you've done
compatibility is important too. If your mod isnt compatible with the "mainstream" mods you will have problem
-
plus, people here are usually very new to coding in general. they're not a threat to the popularity of my mod. IF i ahve somethign to fear. it would be people who are working in secret. (kinda like me)
-
im a bit.. special.. and very confident/positive that my mod will be one of the best in its genre.
But hey, we'll see in 2 month if people like what I've done.
World-gen help
in Modder Support
Posted
well technicly they are, or at least they are produced the same way, what exactly are you trying to achieve ?
also, did you even try my piece of code ?