-
Posts
1511 -
Joined
-
Last visited
Posts posted by hydroflame
-
-
care to point out which tutorial ? mine or someone else ?
-
that mean myclass.instance() return null
-
not really offtopic, actually quite on topic as thats what op is trying to do.
today i learned
-
yes it will work, its true that raytraycing is more popular when used with reflection/refraction/shadow/lighting but thats in the context of graphic rendering. in game programming ray traycing is used a lot to see if the trajectory of 2 object will interact (in your case blocks and your vision)
-
no you got it right in my case i want to have access to the Timer reference in Minecraft (for rendering). so i only need to copy the reference once since it will be the exact same timer during your whole session. but in the case of redstone theres redstone all over the world so you dont want to have reference to everything. what you would do is use reflection every time you need to access it but that slow
btw when we say slow we mean "slower then strong reference" in some case reflection will be "slow" but still fast enough so that your fps wont drop
-
well example in one of my mod i need to read value from a private field in some class, using reflection i am able to get a reference to that object, save it elsewhere and read the value i need from that reference. so i technicly use reflection only 1 time, to get the reference and after i dont need it. basicly its slow while im getting the reference for the first time and after that everythign is smooth.
on the other side sometimes youll need to constantly use reflection so that not super efficient
-
it it being called from server side, i can safely confirm it does (similar feature)
-
And then maybe release 2 versions 1 API compat and one not?
your choice really, if you use strong reference it will generally be faster. but you if the mod is not installed then it wont work (like gotolink said)
if you need to reflect all the time (like every milisecond) then reflection might not be such a good idea but if its only for setup then reflection is awesome!
-
I just have a preference towards command driven interfaces since they're most efficient.
you must be kidding me... yes ok it works well on linux because you have auto complete and drawing all the icons take a butload of time, but for a game ?!?!
sign-shop is the worst system in the world
and really ? efficient?
please tell me how typing "/gold" is faster then opening your eyes:
-
yes and no, im my case i need mana to be sent to the players (and i want the amount of mana to affect how players are rendered, so every client must know about the mana stats of every player)
so in my case i have to take one of the 22 free id and use one to store the mana level
but generally speaking yes people could probably use the datawatcher for their custom mobs without screwing up everything
-
well with 1.6 its actually very easy to change between profile, so in the worst case you could specificly tell that you cannot use this on a vanilla server
but i think you're right and it's not worth it, there's probably only a very small amount of mods that will need to use those and for now we probably wont be running out of id
the minimum that we should do (those who want to use datawatchers) is to get the id from a config file, so that if 2 mods come in conflict the player can always change them
-
hmm...
well... gotolink is rarely wrong so maybe i just read the code wrong
but it seems to me like:
public static final int[] lightValue = new int[4096]; public Block setLightValue(float par1) { lightValue[this.blockID] = (int)(15.0F * par1); return this; }
it will be the same for every block... but considering gotolink post... i would try it just in case
-
good point... i did not think of that, do you remember if the Datawatcher class is loaded when you connect to the server or before that ? (in one case you could simply omit to change the class, in the other you would have to launch the game in "normal datawatcher mode")
-
actually...
/*** How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z
*/
public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
return par1IBlockAccess.getBrightness(par2, par3, par4, getLightValue(par1IBlockAccess, par2, par3, par4));
}
/*** Get a light value for the block at the specified coordinates, normal ranges are between 0 and 15
*
* @param world The current world
* @param x X Position
* @param y Y position
* @param z Z position
* @return The light value
*/
public int getLightValue(IBlockAccess world, int x, int y, int z)
{
Block block = blocksList[world.getBlockId(x, y, z)];
if (block != null && block != this)
{
return block.getLightValue(world, x, y, z);
}
return lightValue[blockID];
}
this seems to be the same for every block in the world
using thsi method you could make the block look bright, but not emit light
-
hmmm, are you usign 162 ? my Block.java only has
/** * Sets the amount of light emitted by a block from 0.0f to 1.0f (converts internally to 0-15). Returns the object * for convenience in constructing. */ public Block setLightValue(float par1) { lightValue[this.blockID] = (int)(15.0F * par1); return this; }
which obviously will be the same for every block in the world (which you dont want )
-
I have a weird system for texturing in my mod and I'd like to make it so that if texture packers include a png file with a certain name it will override my weird texturing system. I know in java there's a file.exists() function but that doesn't seem to work in a compiled jar.
yeah ok, sooo .. whats the problem now ?
-
after more research in the issue i have discovered that there is actually a very low amount of values that are actually used
result:
2013-08-12 10:55:02 [iNFO] [sTDOUT] class net.minecraft.entity.player.EntityPlayerMP
2013-08-12 10:55:02 [iNFO] [sTDOUT] key: 17 value: 0.0 value of type: Float
2013-08-12 10:55:02 [iNFO] [sTDOUT] key: 0 value: 0 value of type: Byte
2013-08-12 10:55:02 [iNFO] [sTDOUT] key: 16 value: 0 value of type: Byte
2013-08-12 10:55:02 [iNFO] [sTDOUT] key: 1 value: 300 value of type: Short
2013-08-12 10:55:02 [iNFO] [sTDOUT] key: 18 value: 0 value of type: Integer
2013-08-12 10:55:02 [iNFO] [sTDOUT] key: 6 value: 1.0 value of type: Float
2013-08-12 10:55:02 [iNFO] [sTDOUT] key: 7 value: 0 value of type: Integer
2013-08-12 10:55:02 [iNFO] [sTDOUT] key: 8 value: 0 value of type: Byte
2013-08-12 10:55:02 [iNFO] [sTDOUT] key: 9 value: 0 value of type: Byte
2013-08-12 10:55:02 [iNFO] [sTDOUT] we are using 9/31 meaning we have 22 free
2013-08-12 10:55:03 [iNFO] [sTDOUT]
2013-08-12 10:55:03 [iNFO] [sTDOUT] class net.minecraft.client.entity.EntityClientPlayerMP
2013-08-12 10:55:03 [iNFO] [sTDOUT] key: 17 value: 0.0 value of type: Float
2013-08-12 10:55:03 [iNFO] [sTDOUT] key: 0 value: 0 value of type: Byte
2013-08-12 10:55:03 [iNFO] [sTDOUT] key: 16 value: 0 value of type: Byte
2013-08-12 10:55:03 [iNFO] [sTDOUT] key: 1 value: 300 value of type: Short
2013-08-12 10:55:03 [iNFO] [sTDOUT] key: 18 value: 0 value of type: Integer
2013-08-12 10:55:03 [iNFO] [sTDOUT] key: 6 value: 1.0 value of type: Float
2013-08-12 10:55:03 [iNFO] [sTDOUT] key: 7 value: 0 value of type: Integer
2013-08-12 10:55:03 [iNFO] [sTDOUT] key: 8 value: 0 value of type: Byte
2013-08-12 10:55:03 [iNFO] [sTDOUT] key: 9 value: 0 value of type: Byte
2013-08-12 10:55:03 [iNFO] [sTDOUT] we are using 9/31 meaning we have 22 free
2013-08-12 10:55:22 [iNFO] [sTDOUT]
2013-08-12 10:55:22 [iNFO] [sTDOUT] class net.minecraft.entity.monster.EntitySlime
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 0 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 16 value: 1 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 1 value: 300 value of type: Short
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 6 value: 1.0 value of type: Float
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 7 value: 0 value of type: Integer
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 8 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 9 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 10 value: value of type: String
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 11 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] we are using 9/31 meaning we have 22 free
2013-08-12 10:55:22 [iNFO] [sTDOUT]
2013-08-12 10:55:22 [iNFO] [sTDOUT] class net.minecraft.entity.monster.EntitySkeleton
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 0 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 1 value: 300 value of type: Short
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 6 value: 1.0 value of type: Float
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 7 value: 0 value of type: Integer
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 8 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 9 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 10 value: value of type: String
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 11 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 13 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] we are using 9/31 meaning we have 22 free
2013-08-12 10:55:22 [iNFO] [sTDOUT]
2013-08-12 10:55:22 [iNFO] [sTDOUT] class net.minecraft.entity.monster.EntityCreeper
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 17 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 0 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 16 value: -1 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 1 value: 300 value of type: Short
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 6 value: 1.0 value of type: Float
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 7 value: 0 value of type: Integer
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 8 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 9 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 10 value: value of type: String
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 11 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] we are using 10/31 meaning we have 21 free
2013-08-12 10:55:22 [iNFO] [sTDOUT]
2013-08-12 10:55:22 [iNFO] [sTDOUT] class net.minecraft.entity.monster.EntityZombie
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 0 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 1 value: 300 value of type: Short
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 6 value: 1.0 value of type: Float
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 7 value: 0 value of type: Integer
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 8 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 9 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 10 value: value of type: String
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 11 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 12 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 13 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 14 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] we are using 11/31 meaning we have 20 free
2013-08-12 10:55:22 [iNFO] [sTDOUT]
2013-08-12 10:55:22 [iNFO] [sTDOUT] class net.minecraft.entity.monster.EntitySpider
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 0 value: 0 value of type: Byte
2013-08-12 10:55:22 [iNFO] [sTDOUT] key: 16 value: 0 value of type: Byte
2013-08-12 10:55:23 [iNFO] [sTDOUT] key: 1 value: 300 value of type: Short
2013-08-12 10:55:23 [iNFO] [sTDOUT] key: 6 value: 1.0 value of type: Float
2013-08-12 10:55:23 [iNFO] [sTDOUT] key: 7 value: 0 value of type: Integer
2013-08-12 10:55:23 [iNFO] [sTDOUT] key: 8 value: 0 value of type: Byte
2013-08-12 10:55:23 [iNFO] [sTDOUT] key: 9 value: 0 value of type: Byte
2013-08-12 10:55:23 [iNFO] [sTDOUT] key: 10 value: value of type: String
2013-08-12 10:55:23 [iNFO] [sTDOUT] key: 11 value: 0 value of type: Byte
2013-08-12 10:55:23 [iNFO] [sTDOUT] we are using 9/31 meaning we have 22 free
2013-08-12 10:55:33 [iNFO] [sTDOUT]
2013-08-12 10:55:33 [iNFO] [sTDOUT] class net.minecraft.entity.passive.EntitySquid
2013-08-12 10:55:33 [iNFO] [sTDOUT] key: 0 value: 0 value of type: Byte
2013-08-12 10:55:33 [iNFO] [sTDOUT] key: 1 value: 300 value of type: Short
2013-08-12 10:55:33 [iNFO] [sTDOUT] key: 6 value: 1.0 value of type: Float
2013-08-12 10:55:33 [iNFO] [sTDOUT] key: 7 value: 0 value of type: Integer
2013-08-12 10:55:33 [iNFO] [sTDOUT] key: 8 value: 0 value of type: Byte
2013-08-12 10:55:33 [iNFO] [sTDOUT] key: 9 value: 0 value of type: Byte
2013-08-12 10:55:33 [iNFO] [sTDOUT] key: 10 value: value of type: String
2013-08-12 10:55:33 [iNFO] [sTDOUT] key: 11 value: 0 value of type: Byte
2013-08-12 10:55:33 [iNFO] [sTDOUT] we are using 8/31 meaning we have 23 free
2013-08-12 10:55:34 [iNFO] [sTDOUT]
2013-08-12 10:55:34 [iNFO] [sTDOUT] class net.minecraft.entity.monster.EntityEnderman
2013-08-12 10:55:34 [iNFO] [sTDOUT] key: 17 value: 0 value of type: Byte
2013-08-12 10:55:34 [iNFO] [sTDOUT] key: 0 value: 0 value of type: Byte
2013-08-12 10:55:34 [iNFO] [sTDOUT] key: 16 value: 0 value of type: Byte
2013-08-12 10:55:34 [iNFO] [sTDOUT] key: 1 value: 300 value of type: Short
2013-08-12 10:55:34 [iNFO] [sTDOUT] key: 18 value: 0 value of type: Byte
2013-08-12 10:55:34 [iNFO] [sTDOUT] key: 6 value: 1.0 value of type: Float
2013-08-12 10:55:34 [iNFO] [sTDOUT] key: 7 value: 0 value of type: Integer
2013-08-12 10:55:34 [iNFO] [sTDOUT] key: 8 value: 0 value of type: Byte
2013-08-12 10:55:34 [iNFO] [sTDOUT] key: 9 value: 0 value of type: Byte
2013-08-12 10:55:34 [iNFO] [sTDOUT] key: 10 value: value of type: String
2013-08-12 10:55:34 [iNFO] [sTDOUT] key: 11 value: 0 value of type: Byte
2013-08-12 10:55:34 [iNFO] [sTDOUT] we are using 11/31 meaning we have 20 free
2013-08-12 10:55:37 [iNFO] [sTDOUT]
2013-08-12 10:55:37 [iNFO] [sTDOUT] class net.minecraft.entity.passive.EntityBat
2013-08-12 10:55:37 [iNFO] [sTDOUT] key: 0 value: 0 value of type: Byte
2013-08-12 10:55:37 [iNFO] [sTDOUT] key: 16 value: 0 value of type: Byte
2013-08-12 10:55:37 [iNFO] [sTDOUT] key: 1 value: 300 value of type: Short
2013-08-12 10:55:37 [iNFO] [sTDOUT] key: 6 value: 1.0 value of type: Float
2013-08-12 10:55:37 [iNFO] [sTDOUT] key: 7 value: 0 value of type: Integer
2013-08-12 10:55:37 [iNFO] [sTDOUT] key: 8 value: 0 value of type: Byte
2013-08-12 10:55:37 [iNFO] [sTDOUT] key: 9 value: 0 value of type: Byte
2013-08-12 10:55:37 [iNFO] [sTDOUT] key: 10 value: value of type: String
2013-08-12 10:55:37 [iNFO] [sTDOUT] key: 11 value: 0 value of type: Byte
2013-08-12 10:55:37 [iNFO] [sTDOUT] we are using 9/31 meaning we have 22 free
meaning we actually have more values to play with then we tought we would (average of 22 free id)
considering the proper usage of these (like i said earlier, values changing a lot like mana or energy) we probably don't need to expand it further then 31 for now
values worth interrest:
Entity uses 0, 1 meaning 29 free id
EntityLivingBase use 0, 1, 6, 7, 8, 9 meaning every single of your mobs has 25 id free!
EntityAnimal uses 12 (as well as every other before) for age. 24 free for your passif mobs
EntityPlayer uses 16, 17, 18 as well as EntityLivingBase so you still have 22 free id! (should be enough for our small needs)
so considering the free space, its probably not a big deal to expand the watch list size, but for the sake of it i did it anyway
all you have to do is remove the check for id>31, change the "writeWatchableObject" method to write [int][byte] (id, type) instead of [byte] (which was 3 bit for type 5 for id) and finally change the "readWatchableObjects" so that it reads [int][byte] instead
@Mazetar, the goal was to use the already implemented system to pack all values in 1 packet and prevent overhead caused by sending multiple packet. but it might be possible to simply add more information after the end byte that vanilla puts in the packet and retreive that information later
@gotoLink, same as maz
-
well you can always use JarEntry or ZipEntry to check the content of a jar
-
hmmm well redstone simply change the block when you click it :\ which isnt really what you want but it could work anyway
/** * The redstone ore glows. */ private void glow(World par1World, int par2, int par3, int par4) { this.sparkle(par1World, par2, par3, par4); if (this.blockID == Block.oreRedstone.blockID) { par1World.setBlock(par2, par3, par4, Block.oreRedstoneGlowing.blockID); } }
i looked quickyl through Block.java and there doesnt seem to be anything but maybe im wrong
-
isnt it the same thing as a texture pack ?
-
Block.java:
/** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public Icon getIcon(int par1, int par2) { return this.blockIcon; }
-
specific answer: no idea
general answer: you could always look at how vanilla code does it
highlight "enchantmentTagList", right-click and click "show call hierarchy". this will show you everywhere in code where this method is called, you can just follor til you find what vanilla code does with it
-
can you post your main mod class please (also, LOL @ the guy saying you should use MCCreator )
-
well specificly "thePlayer" is a field in Minecraft class .. but obviously theres also a couple of place were you can have reference to EntityPlayer objects
about Item.func_111206_d(String s)
in Modder Support
Posted
i dont know who wrote it, but mine is right :
http://www.minecraftforge.net/wiki/Hydroflame_guide_to_textures