Everything posted by MrArcane111
-
[1.6.4] Updating a block every tick
In the block constructor, setTickRandomly to false. Then add an onUpdate method. Then set the tickRate to 1. Hope this helped.
-
[1.7.2] Having a bit of trouble with hasItem/hasItemStack methods [SOLVED]
I see you cleaned up your if statements. (Y)
-
[1.7.2]What is proper entity registration (conflicting tutorials confusion)?
An example from my WIP mod: EntityRegistry.registerGlobalEntityID(EntityBullet.class, "Bullet", EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(EntityBullet.class, "Bullet", Config.entBulletId, Steamcraft.instance, 64, 20, true); If you don't know what each of the values do in the registerModEntity, please read the Forge javadocs.
-
[SOLVED][1.6.4]Model rendering sideways?
Here, read this: http://www.minecraftforge.net/forum/index.php/topic,18005.0.html You don't need that many translations/rotations. Basically, you need to translate to your model's center, rotate it *correctly*, then translate back to original position. If you want your item to rotate in one axis, then set the other floats in the glRotatef method to 0.
-
[SOLVED][1.6.4]Model rendering sideways?
*fishes for example* See in the RenderBiped how it handles bow rotation? if (var4.itemID == Item.bow.shiftedIndex) { var6 = 0.625F; GL11.glTranslatef(0.0F, 0.125F, 0.3125F); GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(var6, -var6, var6); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } I'm not that great at OpenGL, but from what I know, the method glRotatef has the values angle, float x, float y, float z. Determining on what those x, y, and z axis values are determines how it rotates. Keep trying.
-
[1.7.2] Teleporting to where your cursor is at?
Take a look at OgreSean's old Teleport Swords mod: http://www.minecraftforum.net/topic/157524-v181ogreseans-mods-mods-updated-for-181/ It's old, but the vector math is still relevant, you'd just need to change a couple of things to keep it relevant in today's methods. He also has a bit in there about adding "randomness" to the teleport, but you can just get rid of that stuff.
-
[SOLVED][1.6.4]Model rendering sideways?
Look at the glRotatef method. See the 180.0F bit? Tinker with it and see what happens.
-
[1.7.2] Block Texture problem
Do you think it has to do with the fact that air is see-through? You can always make a custom Material if you need to, but I have no idea why you'd need to use Material.air for anything. Especially for an (apparent) NPC spawner.
-
[1.7.2] Having a bit of trouble with hasItem/hasItemStack methods [SOLVED]
Can you show me the rest of your method?
-
Armor not rendering
A couple of things. 1. Your method getArmorTexture should use @SideOnly(Side.CLIENT) because all texture related stuff is handled client-side. I just checked on this bit, and you do NOT need this. My mistake! 2. Is the armor custom as in made with Techne custom, or as in retextured vanilla custom? The two are handled very differently.
-
[1.7.2] Having a bit of trouble with hasItem/hasItemStack methods [SOLVED]
Well, if you want the player's held item, I'd suggest using player.inventory.getCurrentItem() Additionally, it's java coding convention to separate the parts of your if statement with parenthesis: if ((blarg < -1) && (cat > 12) {} Unless you just wanted to check if you had the item in the player's inventory?
-
[1.7.2] Can you make a config change things like light value?
The config uses the get method, but it won't process a float, but that's okay, just make it a double and then cast it as a float in the light value method.
-
1.7.2 - Adding a prewritten book to player's inventory
Check OpenBlocks' GitHub repo. I think Mikemoo (or whoever) likes to add the changelogs in *regular* books—not his special, custom GUI book.
-
Potion Effect Particles
Really? You don't think world.spawnParticle is obvious enough?
-
Setting Block bounds and collision?
Well, you'd have some code in the updateTick or onNeighborBlockChange method that would determine if a part of the multi block structure was removed—similar to how a torch determines if the block it's placed on is removed. In any case, it's not as hard as you think, and there are oodles of resources at your fingertips for learning how to create such a structure—maybe check mDiyo's TiCon smeltery thingy (sorry!) for starters.
-
[SOLVED] [1.6.4] Getting when a block is looked at?
There's an event called DrawBlockHighlightEvent (or very close) which allows access to MovingObjectPosition. All you would need to do is check if the block you mouse over is the block you want.
-
[1.7.2] Change item angles/position/scale
You can create a renderer that implements IItemRenderer. It has three methods: handleRenderType, shouldUseRenderHelper, and renderItem. Additionally, you'll need to register your ItemRenderer in your ClientProxy: MinecraftForgeClient.registerItemRenderer(YourMod.yourItem, new YourItemRenderer()); Please read the following for more info: http://www.minecraftforge.net/wiki/Custom_2D_Inventory_Item_Renderer Even though the example is for inventory rendering, I believe it can be applied to first and third person viewing. Hope this helps!
-
[Solved] Is it possible to run Minecraft through eclipse with your own account?
Hmmm...this doesn't seem to work now...is there a new way to do it? EDIT: Literally as soon as I posted this, I got it working. Now, all you need to do is go to Run, then Run Configurations. Click on Client under Java Application (there are two Client, but you only need to edit one). Then, under the arguments tab, find the Program Arguments. Now type: --username YOURUSERNAME and replace YOURUSERNAME with your username (duh). Hope this helps!
-
[1.7.2] Having Problems setting up GradleForge with Eclipse on Mac
Two side notes: 1. If you are STILL having decompile failures, you may need to allocate more ram to Gradle. Open the gradle file with TextEdit, and look around line 11, where it says: DEFAULT_JVM_OPTS="" Change it to however much RAM you nee. I used two GB: DEFAULT_JVM_OPTS="-Xmx2048m" 2. Also, do NOT use 'bash' before typing ./gradlew...literally copy and paste the above quoted code (line by line). Anyway, this is how I was successful. Hope this helps! P.S. This works with the latest build of forge (1.7.2 Forge: 10.12.0.1039) just in case you're wondering. If you have any questions, I'll try to help as best as I can!
-
[1.7.2] Custom Bow Render
First off, you need to add two more methods in your ClientProxy to register your EntityRubyArrow: EntityRegistry.registerGlobalEntityID(EntityRubyArrow.class, "NameID", EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(EntityRubyArrow.class, "NameID", put unique int here, MainModClass.instance, 100, 10, false); For the registerModEntity method, the first field is the Entity class file: in your case, it's the Ruby arrow. Second, is a name forge uses to identify the entity. Ideally, you'd want to make the name sensical. The next is an integer. This is the unique entity ID. I like to keep all my entity IDs in a separate class file, but you can put in any int in there. Next is your main mod class instance. Then the next two integers are tracking ranges and update frequencies. I suggest leaving them at 100 and 10 just to keep it simple; you can adjust them later if you know what they do. Then the last parameter is a boolean which determines if it will need to send velocity updates. For an arrow, it doesn't, so leave it as false. Additionally, in your Render class, you need to change it to your EntityRubyArrow instead of EntityArrow. If you need further help, please feel free to browse around my mod repository (i.e. run a repo search) for "EntityBullet" related things where I've got entities working. https://github.com/MrArcane111/Steamcraft-2
-
[1.7.2] [Solved] How to display a chat message on enter in a world?
I like using ChatMessageComponent because you can do things like 'messageComponent.setColor(RED)' - approximate code, and italics and things.
-
call a method from a specific block using the blocks co-ordinates
Can't you also use a Block Event? It handles the Block object as well as x, y, and z coords.
-
call a method from a specific block using the blocks co-ordinates
You can use ray trace, or you can make the method on the client side and call the minecraft objectMouseOver coords. It can grab the x, y, z coords of a block. But ray trace is probably your best bet because it can be done server side.
-
[SOLVED] Problems With Tick Handlers (Casting World to Object[])
I think I've graduated Java basics. I want to learn advanced physics (and the mathematical computations involved) and OpenGL. I'm also working on a 2D RPG. I haven't taken a formal class, but I've read books and read plenty of online tutorials for Java basics. Unfortunately, they do not offer Java (or any coding class for that matter) at my school, so everything I have learned thus far is from self-teaching.
-
HarvestDropsEvent - Removing and Adding Drops
Now that I have Eclipse reopened, they must've changed it to "getItem()" but you're right, it isn't needed. I will update this post once I try your suggestion. Thanks.
IPS spam blocked by CleanTalk.