-
Posts
840 -
Joined
-
Last visited
Everything posted by delpi
-
[UNSOLVED]Problem with IExtendedEntityProperties
delpi replied to ItsAMysteriousYT's topic in Modder Support
In your event try "RLMPlayerProps.register((EntityPlayer) event.entity)) instead of "event.entity.registerExtendedProperties(RLMPlayerProps.EXT_PROP_NAME, new RLMPlayerProps((EntityPlayer) event.entity);" you don't really need to have that in two places. Now, for your problem on not saved, I believe it is because you are overwriting the data each time. you need to check for the property to exist before writing it. Add this to your property: In your construction I suspect you used Jabelar's tutorial (which is great) but from looking at it, its a one time horse, not a long term recuring entity like the player. I originally used this one to learn it. https://github.com/coolAlias/Forge_Tutorials/blob/master/IExtendedEntityPropertiesTutorial.java -
So what I have done is dynamically from a config file created any number of world sets specified. Basically you can have as many overworld, nether, end combinations with a long list of specifications you want. It also spawns some other set worlds with them that I wanted too, but that is another story. The question was around enderframes and portals. I needed to intercept when a player found one in a non original overworld and change up what was happening. I got it to work. Basically I changed my customenderframe to be like what was suggested. then for the event, I let it happen but record in a list to revisit the area a tick later and change anything over to my blocks and determine to take action on portal based upon findings. Works like a charm. I realize there are other ways to do this, but its how I had everything setup. It all worked before except for the ender eye flying off as a bonus. Now it is seamless.
-
I didn't want to say this till I got home and looked, but I had already done what diesinben07 told me. The error for anyone that might run into this, this was the error. Referring the item as instance.Block_Manager.creespsidion crashes Referring the item as Block_Manager.creespsidion works fine.
-
When I leave TheEnd (dimension 1) it unloads. It is then no longer listed as a world in 'MinecraftServer.getServer().worldServers'. It makes going back to it sorta hard. Is there anyway to stop this or to force reloading it? Right after posting this I looked at 'worldServerForDimension' and it showed how.
-
I did say it was like the other one. Just give you some more info.
-
Gotcha. Something like was suggested might work. I did something like that in the past. Its been awhile since I did this, but I think there is an arrow loose or spawn event. I'll look around tonight for my mod that uses it. Anytime that happens, I add the arrow to a list where i'm tracking the age of the arrow once it is in the ground. I iterate through the list each tick and advance the time if it meets my criteria. After a short time, I make it go poof. I created this for some NPC's I made that shot a lot of arrows. They lag from the 1000's of arrows hanging around too long was ugly.
-
Anytime I try to use one of my blocks as the icon for a custom creative tab, minecraft will crash when I open the creative inventory. I suspect this has to do with order. I need to have the new creative tab exists before i generate my blocks so I can specify it, but .... then the block isn't registered by then so it probably puts in a null. Anyone found a way around this?
-
What are you trying to do when it impacts a block? Might be easier to tackle from that direction.
-
Ah, I didn't realize that before. I didn't realize the status of blockactivated impacted the items own rightclicked code. I should have traced that out. I'll give that a shot tonight. Thanks guys. If it was a vanilla block and I wanted to cancel the ender eye, can you think of any way to do it on the 2nd round of the event other than what I posted above?
-
I don't think its from click being held down to long. It happens each and everytime without fail. I'll add the blockpos tonight to check. On the block activated idea, I didn't explain well enough. I'm fine on the block. Everything works there. I'm trying to stop the ender eye from flying out in the blue yonder when I use it on the block. I'm consuming it on the block, not wanting it to be used to find another block. Unfortunately since the cancel isn't working for the 2nd event, both happen.
-
I just came across an oddity in events that I could use some advice on how to solve. Basically I have a custom End Portal for my multi-dimension mod. Got everything working right except for one thing. When the portal frame is clicked, it deposits the ender eye and it launches it in sky to track. In the serverside event (yes, I'm sure this is happening only serverside), the rightclick event fires twice. The first time through the event reports the block that was rightclicked was my portal frame. I successfully cancel the event. But then, the event runs a second time and it reports back a different block. Usually this is bedrock, but occasionally something else. I'm up at a y of 100 or so. I played around with it a bit and looked at the original frame/eye code, but not really seeing any gracefull way to solve this. I could come up with some tracking system to know that the two are related and cancel on the same tick, but that is just going to be ugly. Any advice?
-
[1.8] Override on onEntityCollidedWithBlock not working [solved]
delpi replied to delpi's topic in Modder Support
Nevermind, wrong base method public void onEntityCollidedWithBlock(World world, BlockPos pos, Entity entity) { vs public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) -
I get it now. Thank you Choonster.
-
Just noticed some of my code was wrapped weird in the post. might be hard to read. If I setBlockState, that sets the entire block again. I just want to modify a few of the state properties and leave the rest alone.
-
diesieben07, I went to look this up out of curiosity. in 1.8, here is the method in DamageSource Did something change?
-
Looking at the bed in 1.8, I see another way around this in terms of avoiding the explosion. However, I still would like to know about the state copy I put above.
-
I've been looking through vanilla and I think this works. Would someone confirm if I've got this right or if I'm missing stuff. My goal is to put down a custom bed in place of the normal one so it doesn't blow up in my custom dimensions.
-
Are you talking about in first person?
-
I told you to look at two other things than that.
-
Did you look at the other items I mentioned above?
-
Someone may have a more graceful way to do it, but there is a tick event for items in your inventory. Just check for enchantment and remove if detected. Blocking it would be less of a load, perhaps you should look at enchantment books and see how they work to find a way to block it.
-
[SOLVED] Two drops while overriding Block.removedByPlayer
delpi replied to SnowyEgret's topic in Modder Support
you should only create the drops on the serverside. Just do a check to see if !world.isRemote() and only run if that is the case. -
Not the cause but should your <=1 should be <= 0 right below "ItemStack itemstack = BloodTransRecipe.Transforming().getTransformingResult(this.slots[0]);", put a print statement to make see what it is telling you it found as an item. That will probably answer what is up. I'm betting it is null. I haven't messed with custom recipes like that much, but something is up. you are passing in two source items, but only using the first one as you progress through your functions.
-
[1.7.10] Tile Entity ceases to work after world reload
delpi replied to TheDoctorSoda's topic in Modder Support
No, that is the code for a single method of your tile entity class.