-
Posts
444 -
Joined
-
Last visited
Everything posted by brandon3055
-
[1.8] Rendering of non-water blocks underwater
brandon3055 replied to 10paktimbits's topic in Modder Support
That sounds like something maby forge should do. -
Designating HotBar slot as CustomArmor slot
brandon3055 replied to jewell012's topic in Modder Support
Im not sure exactly what you are asking. Are you saying you want an item in a hotbar slot to act as armor? If so you could use the LivingHurtEvent check if your item is in the slot and apply some damage reduction. -
[1.7.10]How to I get entityPlayer of my own character?
brandon3055 replied to TheiTay's topic in Modder Support
When you receive a packet from a client it gives you the player that sent it. ctx.getServerHandler().playerEntity -
Custom fire block won't burn entities, works fine on blocks.
brandon3055 replied to WolfAmaril's topic in Modder Support
Oh come on dont make it sound so impossible. I happen to have a custom fire block im my mod that also dose not go out when you left click it (Thats the way i want it) It took me 2 minutes to achieve what you are trying to do using PlayerInteractEvent. Here is part of what i came up with. @SubscribeEvent public void playerInteract(PlayerInteractEvent event){ if (event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK){ if (event.world.getBlock(event.x, event.y + 1, event.z) == "Your fire block"){ event.world.setBlockToAir(event.x, event.y + 1, event.z); } } } That will extinguish the fire if you click the block under it. However it will not work if the fire is on the side of a block i will let you figure that part out for yourself but i have done most of the work for you. Hint: ForgeDirection will be a big help. -
Custom fire block won't burn entities, works fine on blocks.
brandon3055 replied to WolfAmaril's topic in Modder Support
@SubscribeEvent And the class it is in needs to be registered to the correct event bus. Edit: Maby i should just stop trying to beat you lol. -
Custom fire block won't burn entities, works fine on blocks.
brandon3055 replied to WolfAmaril's topic in Modder Support
If there is i dont know it but you could just leave that out altogether. It wouldnt work exactly like vanilla fire but it would go out when you hit it. I think that is used to check that you hit the bottom of the block so without it it wouldnt matter where you click as long as you hit the fire block. I may be wrong. Edit: You may be able to use ray tracing. -
Custom fire block won't burn entities, works fine on blocks.
brandon3055 replied to WolfAmaril's topic in Modder Support
Sorry but i must agree with diesieben. You are using this.getBlock(x, y, z), this.playAuxSFXAtEntity and this.setBlockToAir. "this" Is not the world object! please learn how java works. Edit: And you beat me again lol. -
Custom fire block won't burn entities, works fine on blocks.
brandon3055 replied to WolfAmaril's topic in Modder Support
Darn you beat me to it lol guess i need to get faster at searching through the minecraft code. -
Thats really not a good option because not only dose it not do what he wants (he wants to change the camera position not the fov) but it actually changes the fov setting so you have to find a way to store the current value and restore that value when you are done. That is why forge added FOVUpdateEvent That dose exactly the same thing as changing mc.gameSettings.fovSetting;
-
You may be able to do that using FOVUpdateEvent. Edit: Nope that wont work... Not sure how to do what you want.
-
[1.7.10] Making a block that you can walk through.
brandon3055 replied to Noodly_Doodly's topic in Modder Support
Did a little digging and solved the mystery. This is the code in EntityLivingBase that applies suffocation damage if (this.isEntityAlive() && this.isEntityInsideOpaqueBlock()) { this.attackEntityFrom(DamageSource.inWall, 1.0F); } And the code that checks if the entity is inside an opaque block inside Entity public boolean isEntityInsideOpaqueBlock() { for (int i = 0; i < 8; ++i) { float f = ((float)((i >> 0) % 2) - 0.5F) * this.width * 0.8F; float f1 = ((float)((i >> 1) % 2) - 0.5F) * 0.1F; float f2 = ((float)((i >> 2) % 2) - 0.5F) * this.width * 0.8F; int j = MathHelper.floor_double(this.posX + (double)f); int k = MathHelper.floor_double(this.posY + (double)this.getEyeHeight() + (double)f1); int l = MathHelper.floor_double(this.posZ + (double)f2); if (this.worldObj.getBlock(j, k, l).isNormalCube()) { return true; } } return false; } And finally isNormalCube inside Block public boolean isNormalCube() { return this.blockMaterial.isOpaque() && this.renderAsNormalBlock() && !this.canProvidePower(); } And that is how renderAsNormalBlock affects suffocation damage. -
Have you tried starting from scratch with a fresh new workspace? Just to be clear incase you are not 100% familiar with how the setup process works. 1. Download the latest forge src for the version you want to use (1.7.10 or 1. and extract its contents to a new folder 2. Open your command window in that folder (for windows shits right click inside the folder and click "open command window here") 3. Run "gradlew setupDecompWorkspace" Then run ether "gradlew idea or gradlew eclipse" depending on which ide you use And thats it you now have a working workspace that you can import into your ide
-
[1.7.10] Making a block that you can walk through.
brandon3055 replied to Noodly_Doodly's topic in Modder Support
Given that that is the first post on your account im just going to assume that you are trolling. If not go learn how minecraft works. As for the topic of this post overriding getCollisionBoundingBoxFromPool and returning null should work i have done it in the past and it worked perfectly. Just to make sure i wrote the following to test it. import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; /** * Created by Brandon on 7/01/2015. */ public class TestBlock extends Block { protected TestBlock() { super(Material.wood); this.setBlockName("testblock"); this.setCreativeTab(CreativeTabs.tabBlock); } @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { return null; } } That worked just fine for me so if it dosnt work for you there is something else going on. But given how old this thread is im guessing no one cares anymore because this has long since been solved or abandoned. Edit: So i figured out that the problem is when you stack two of them and try to walk through them. To fix it override renderAsNormalBlock and return false. So maby Sbeagin's post wasnt as trolly as i thought but still not a great explanation. -
[1.8] [SOLVED] Draw the icon of an item and text on the screen
brandon3055 replied to momar's topic in Modder Support
Your first approach may work. Unless there is something different about the record textures the texture should be 16x16 so why are you trying to draw it as 255x255? You can also rescale it using GL11.glScale -
No, TESR is pretty much unchanged. Well thats a relife but how would you do the item renderer?
-
Im guessing that also extends to tile entities? Unless enough of us petition Lex to add IItemRenderer back in... Is there a thread for that?
-
Add "lore" to an item without making its own class?
brandon3055 replied to Ms_Raven's topic in Modder Support
Pro tip: Vanilla already has a way to add lore to items. I dont use it because addInformation works better for my purpose but the advantage to the vanillla way is that you can also use it to add lore to vanilla items. Here is an example of how to use it. ItemStack stack = (any ItemStack) NBTTagCompound nbt = stack.getTagCompound(); if (nbt == null) nbt = new NBTTagCompound(); NBTTagList lore = new NBTTagList(); lore.appendTag(new NBTTagString("lore line 1")); lore.appendTag(new NBTTagString("lore line 2")); lore.appendTag(new NBTTagString("lore line 3")); //etc NBTTagCompound display = new NBTTagCompound(); display.setTag("Lore", lore); nbt.setTag("display", display); stack.setTagCompound(nbt); -
[1.8]Is there any information about BlockState out there yet?
brandon3055 replied to brandon3055's topic in Modder Support
In that case that may be a possibility for me aswell... Im only about half way through the process of fixing all the errors in my classes, then i need to learn the new texture/model system and then finally i need to go through and fix everything that has been broken by the update... And on top of that i still have a ton of content i want to add to 1.7.10. I know in the past there have been a lot of mc versions that most modders have completely skipped would you consider 1.8 to be one of those versions? -
[1.8]Is there any information about BlockState out there yet?
brandon3055 replied to brandon3055's topic in Modder Support
Thats where i was a bit confused. Why make it so much more complex when metadata in a lot of cases was so much easier? I can see the potential benefit with the new system but a way to set metadata directly would have been nice. Oh well thanks for the replies. -
Just wondering if there is any detailed information/tutorials about the new BlockState added in 1.8? I have managed to put together bits of information from various posts and the minecraft code and i think i have a basic understanding but i would really like all the information available before i start messing with it.
-
Minecraft forge mod: Remove a block and place a new block
brandon3055 replied to halmi4's topic in Modder Support
To actually replace the block use world.setBlock(x, y, z) [1.7.X] world.setBlock(pos) [1.8] (not sure if that's correct haven't updated to 1.8 yet) -
Any guess how the change to updateEntity in TileEntity effect things? I was a little confused when i took a look at one of my tile entities and tried to fix the error with onUpdate. I had to look at TileEntityFurnace to figure out that you now need to implement IUpdatePlayerListBox (That seems like a weird name?) and implement its "update" method which seems to replace updateEntity. My only guess is it is to make non-updating tileEntitys more efficient but im guessing thats not why it was changed.
-
Adding a custom inventory slot just for my Item?
brandon3055 replied to Asweez's topic in Modder Support
Create a custom slot class that extends Slot. Override isItemValid(ItemStack stack) and return true if the itemstack contains your item.