
N247S
Forge Modder-
Posts
222 -
Joined
-
Last visited
Everything posted by N247S
-
In your modelrenderer class you should add a rotation to the model according to its metadata. In order to do so, you simply have to get the blocks metadata through "this.tileEntity.WorldObj.getBlock(x, y, z).getBlockMetadata()". Next you could use a switch methode, and set the right rotation ("Gl_setRotation()") for each metadata.
-
I would recommend taking a look at the vanilla chest class. It sets the blocks metadata according the players rotation when its placed. The only thing you have to do next is get the blockmetadata in de modelrenderer class, and set the right rotation for each metadata.
-
[1.7.10] [10.13.2.1291] [SOLVED] Force rendering for block
N247S replied to Filipsi's topic in Modder Support
First of all, that looks realy good. And I'm curious to see how you did this. Besides, you try to render an Item, wich means you cant change it's state. Basicly this is how it is rendered in your hotbar. So a workaround would be to create your own custom cob.wall without the connected parts, and use that one instead. -
Opening a player's inventory on another player's screen
N247S replied to Asweez's topic in Modder Support
A gui is nothing more than a screen wich displays data you put in. in order to be able to ineract with a gui, you need an regular guiHandler and Gui class. Beside that you need an container wich is linked to your Gui. (The container class containes the data and methodes to update the Gui). So in order to display an other players inventory, you'll need to get the instance of the other player in your container class, and use ot to retrieve data. Thats basicly it. Other than that, its just an regular Gui setup -
A dropped item is actualy an entity, so you can use the "isInWater()" check for that. Also there are ways to get the specific items wich the entity contains so... no need to use the playerDropEvent
-
I think your container isn't updating correctly, cause you need the "detectAndSendChanges()" methode to sync a client with the actual magi inside a GUI. I would recommend taking a peek at a vanilla container class to see how the methode should look like.
-
If this doesn't work you can make an fake slot. Just simply create your own slotclass (extending Slot) and set the "isItemValid()" and "canTakeStack()" to false.(not sure if these are the exact methodes, but you'll have to add the right one anyway if you extend the Slot class)
-
Opening a player's inventory on another player's screen
N247S replied to Asweez's topic in Modder Support
I dont know if this is going to work, but whe adding a slot to a container, you can put in an EntityPlayer IInventory Slotindex etc.. What if you pass through the target player and put it in the addslot methode Instead of the player wich opens the container? -
[1.7.10] How to make a tool break more then one block?
N247S replied to HappyKiller1O1's topic in Modder Support
I think the best way to solve this is checking if a block can be broke before you break it. You can simply use world.getBlock(x,y,z) in combination with a check for that. -
I think you made a misstake when posting your codes, cause your tileEntity class is exactualy the same as your gui class. also, you said the game crashes whenever you open the gui. Could you post the crashlogg along with the tileEntity class please?
-
First of all, try an other virtual machine to upload your images, cause this site gave me a ton of security warnings. Second, you use the addVertex methode, wich is mainly ment for 2D rendering. so try to make an actual model instead. I think yourd problem would be solved
-
[1.8]Annormal status , How to stun a mob ??
N247S replied to perromercenary00's topic in Modder Support
It is working I think. The only problem is that it is only aplied for one single tick. Thats why you dont noticed it. So there are multiple solutions to this. 1) create an tickHandler and let it decrease(or increase) a value Every tick. Aply you "stun effect" every tick till the value reahes a certain point. 2) use vanilla! Yep, what I described above is actualy done by vanilla, its called potion effects. you could simply aplly slowness (with level 10 for example) to achieve your goal. note, its not recommended to use ".setInWeb". its better to modify the targets motion Instead. I hope this helped you out! -
Coulx you please add the crash logg? Usualy it is pointing straight to the right methode, so it could save some time.
-
Hey, I don't know if this is the exact the same methode name, but you should be able to put in a chek with entityPlayer.isCreativeMode() or something. Its something simple like that.
-
Hey, its hard to solve this without the container class. But I found one methode wich seems to make problems. its clear(). You just said itemsack = null. although there is just one slot. You still need to specify wich stack from wich slott = null.
-
As projectiles affect other players, it is the best to spawn it on the server side only. just add a litle check before spawning If(!world.isRemote) { //your spawn projectile methodes }
-
Hey, I posted a topic before, but unfortunatly nobody knows how to solve the problems. I figured some of the problems out already, but there are 2 still standing. 1. The particles I spawn have an offset lower than 0.01, but the offset is still clearly visible. I spawn them above an TileEntity, so the coords should be the same for all of them. 2. the particles are moving with the player. It sounds wierd, but whenever I move the player, the particles move along with the player for about 3/4 block, and stay there until I stop moving. than they will return to their original place. I tried to make an video of it, with me moving left and right, showing the particles flying left and right with the player. the link below is to an .jar file with the codes and the clip. https://www.dropbox.com/s/dbthloptx75p8aw/Particles.rar?dl=0 I hope somebody can point me in the right direction! Thank you!
-
[1.7.10][Forge-10.13.2.1291] possible bug with ClientTickEvent
N247S replied to N247S's topic in Modder Support
@Ernio Thanks for sharing your experiance! I didn't know it is suppose to be this way, but its still interresting to see that the ClienTicks are only started when a world is loaded. -
[1.7.10][Forge-10.13.2.1291] possible bug with ClientTickEvent
N247S replied to N247S's topic in Modder Support
@jabelar I'm not English so I have a hard time understanding what you're trying to point out. But basicly what you're saying is: It shouldn't call the methode, but cause its phase START, its still calling runTick()? No matter how I look at it, it is wierd. I can imagine it will ignore a paused game somehow. but it makes zero sence to me why it is called in the gamemenu(after the world is closed). cause there shouldn't be any tick events possible. Luckly there is a work-around, but I'm sure there are some getting a headache of this. -
Hey, I was strugling with some clientside updates, and I noticed that there is a possible bug. What I did was making a simple Tick Handler, and registered it with this: FMLCommonHandler.instance().bus().register(new TickEventHandler()); this is the EventHandler class @SideOnly(Side.CLIENT) public class TickEventHandler { @SubscribeEvent public void onTickEvent(TickEvent.ClientTickEvent event) { if(event.phase == event.phase.START) { //some code wich get executed every tick } } } I added a debug line to this code to see when its called, and I noticed it got called in the following situations: 1. When a world is running (SP) 2. When a world is paused(SP) 3. When a world is closed after it was startup once!! You can imagine that this went pretty crazy with my mod.(and my head!) I solved the problem for me already, but I was curious if this is something normal, or a bug with this forge version? The solution is as follows: //if(event.phase == event.phase.START) - replace this with the following: if(event.phase == event.phase.START && !Minecraft.getMinecraft().isGamePaused() && Minecraft.getMinecraft().thePlayer != null)
-
Hey, it wouldnt work if you just do "setStepSound()". this will mean you have to actualy walk on top of them. But since you climb a ladder it wouldnt work. In the vanilla codes, "BlockLadder", I found this. add it to your code and see if it worked out @Override public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) { return true; }
-
lol, didn't see your link, anyway try to ad this: public int getBrightnessForRender(float brightnessFR) { return 0; //or another low number } I'm sure your particle will be black , Ik it's not clean but it works! Anyway, we are getting a bit off topic here. There are still 2 problems I realy don't know how to solve. Is there anyone who have an idea?
-
Are yo using an EntityFX layer below 3? Cause they have an renderer already wich might cause this Problem. Anyway, does anybody knows where the particle movements come from?(the movments wich are linked with the players movement) And Does anybody know where the undifined offset is comming from?
-
I know that this isn't the right place but I want to say this, Eventhough I can't help you. I still think that this mod(idea) is awesome! I'm verry curious what the end product will be.