Everything posted by Draco18s
-
[1.7.10]Various world infos
world.getWorldTime world.getBiomeForBlockCoordinates world.isRaining
-
[1.7.10] Detect if player is looking at the sun.
There's already a function that converts worldTime into a sun angle. Ah here, world.getCelestialAngle(0) . The 0 is a time offset, so passing 0 means "right now" and passing 6000 would mean "the height 6000 ticks from now." The returned value is an angle (in degrees, iirc). I'm using it like this: float sunHeightVal = (float)Math.sin((event.world.getCelestialAngle(0)+0.25f)*2*Math.PI); As I'm interested in knowing how high in the sky the sun is. The +0.25 is needed as getCelestialAngle actually subtracts a quarter of a rotation out (see WorldProvider line 102), then I convert to radians and Math.sin that.
-
Three Icon problems
Again, you're going to have to insert some debug statements to determine the cause. I can't give you any more help from here.
- [1.7.10]GUI Drawing
-
Three Icon problems
Ok, from that, I get the following: Looking at Render_Immersion_Tank.java line 37, I see the call to renderFaceXNeg. renderer.renderFaceXNeg(block, x, y, z, newIcon); Only two things could possibly be null here: block or newIcon . My bet is on newIcon . Insert some debug statements to figure out which path through your if statement the code is taking and what value newIcon has at each step. Work backwards until you figure out where the null is coming from and why.
-
[1.7.10][SOLVED] Texture Overlay
A texture is just that a texture. If you want to render two at once, you need to render in multiple passes.
-
Three Icon problems
You got a crash, which is a Null Pointer, and you didn't bother including the crash report.
-
[1.7.10] AttackEvent calling method only once
Packets.
-
[1.8][SOLVED] Has Anyone fixed their portals for their custom dimensions?
Follow the chain. Where is that function called from? Trace it back until you find where the call originates with a block. And no shit it doesn't use your teleporter. The point is to figure out how the original function is used so that when you make the call passing your teleporter, you're doing it in the way that the system expects.
-
[1.8][SOLVED] Has Anyone fixed their portals for their custom dimensions?
But where is transferEntityToWorld(Entity entityIn, int dim, WorldServer old, WorldServer new) called from? That's my point. I'm not saying "use this function" I'm saying "how is this function used in vanilla?"
-
[1.8][SOLVED] Has Anyone fixed their portals for their custom dimensions?
My point was: Trace back the call structure. How is vanilla doing it differently than you are?
-
[1.8][SOLVED] Has Anyone fixed their portals for their custom dimensions?
Right, that one specifies that the teleporter being used takes you to the nether (or back).
-
Help with nbt
I can't read your code well enough to figure out what's wrong. But, just as a dead-simple method that flattens things (but is not necessarily) the best: for(x) { for(y) { for(z) { nbt.setInt(x+","+y+","+z, array[x][y][z]); } } }
-
-deleted-
Iiiiiin your sword class.
-
[1.8][SOLVED] Has Anyone fixed their portals for their custom dimensions?
Ah, well that's a bummer. You might have to take a look at what calls transferEntityToWorld (there's two, btw) and see how Vanilla does it.
-
[1.7.10]GUI Drawing
You can have the slot graphic portion exist separately from the background and draw it only when needed, like how the furnace draws the arrow filling up or the heat meter going down. Only instead of a progress bar, it'd be a yes/no type thing.
-
-deleted-
override getContainerItem(ItemStack stack)
-
[1.8][SOLVED] Has Anyone fixed their portals for their custom dimensions?
I think so. I've only ever dealt with trans-dimensional teleport once, and it was only for players (required "feeding" an entity). And that was a while ago (in 1.6). But I was able to use what little I did know about the dimensions system to dig that up. No, I don't recall why I ever needed to access a reference to a specific dimension.
-
Edit existing blocks
A few things I've learned having to deal with these events: There's four events you need to be concerned with. Chunk generation. There's a thousand different events here, you'll need to figure out which one you need, if any ChunkSave. Save the data, duh ChunkLoad. Read the data ChunkUnload. Cleaning up your data so you don't have a memory leak. [*]#4 there is not strait forward. ChunkSave will run after ChunkUnload, so you should either a) keep a Weak reference to the chunk object itself for mapping your data in a HashMap<Chunk, MySpecialData> or b) use the event to note which chunk has been unloaded, and then when ChunkSave happens, also remove the data from memory. [*]Chunk NBT is just like any other NBT, you can read and write to it very easily, you just have to translate your data structure into primitive types. You can actually cheat and just look at the world when the block updates. Examining the world doesn't take that much CPU time (I've clocked it: examining an entire chunk takes about 0.6 milliseconds† even when using world.getBlock instead of directly accessing the chunk block arrays). You'll lose a small portion of realism by taking shortcuts, but it'll be easier to code. e.g. searching NSEW in straight lines will be easier to write (but less accurate) than trying to A* to bedrock. †This is based on my own code and using Time.getNano().
-
[SOLVED][1.8] [SimpleNetworkWrapper] Crash when sending packet.
Create a new class.
-
[1.7.10]GUI Drawing
That depends entirely on what it is you are trying to do. Clarify your idea. But I'm not writing the code for you (not unless you want to pay me).
-
[1.8][SOLVED] Has Anyone fixed their portals for their custom dimensions?
It's funny what you find looking at the ServerConfigurationManager class. MinecraftServer.getServer().getConfigurationManager().transferEntityToWorld(entity, dimID, oldWorld, newWorld, teleporter) If you need a WorldServer object for those two parameters, DimensionManager.getWorld(id)
-
[SOLVED][1.8] [SimpleNetworkWrapper] Crash when sending packet.
Question: Why is this line here? MinecraftForge.EVENT_BUS.register(this); Your main mod is not, and should not be, an event handler. Yes, it has @EventHandler annotations, but the event bus looks for @SubscribeEvent (which you do not have), so why are you trying to subscribe your main class to the event bus?
-
[1.7.10]GUI Drawing
Yes, you can supply a slot that corresponds to another container.
-
[1.7.10]GUI Drawing
If you have no slots in your GUI, how are you displaying a chest in a slot? http://imgs.xkcd.com/comics/well_2.png[/img]
IPS spam blocked by CleanTalk.