Everything posted by Draco18s
-
[1.5.2]A mod tried to open a gui on the server without being a network mod
Yes. Delete the tile entity. You're not using a tile entity. At all. Anywhere. Get rid of it. Player inventory screen is not a tile entity.
-
Rendering Items Like the Clock
Yes. And that's why not. Oh man, that helps. I'll take another stab at it today. Yay! Man, that was obtuse; don't think I'd have ever figured that out on my own. Thanks.
-
Rendering Items Like the Clock
I want to render an item in a similar manner to the clock or compass, which uses an animated texture, but is not animated on a per-frame basis, but rather on other events (e.g. time, like the clock). The way vanilla does this is it uses a subclass of TextureAtlasSprite and inside that it manages the animation directly. However, there does not be a way to register a TextureAtlasSprite in such a way that actually WORKS. In theory, this should work: @ForgeSubscribe public void registerTextures(TextureStitchEvent.Pre event) { event.map.setTextureEntry("modid:calendar", new TextureCalendar("modid:calendar")); } But it doesn't, as you can only register sprites for objects that don't already have one registered, and by the time this event is called, there's already an entry in the Hashmap for that string (which is the same as the item's texturename*). "Wait," you say, "You're trying to load a texture entry before any entries have been registered (TextureStitchEvent.Pre) and you can't because there's already an entry!?" Yup. It happens to be blank, but it DOES exist in the hashmap. TextureAtlasSprite{name='modid:calendar', frameCount=0, rotated=false, x=0, y=0, height=0, width=0, u0=0.0, u1=0.0, v0=0.0, v1=0.0} The texture I'm using obviously doesn't have 0 frames and 0 height and width. But none the less that entry prevents me from registering my own TextureAtlasSprite. How the hell am I supposed to do this? *Using a different string doesn't work, as the item's texture string is used as a lookup in the hashmap. Changing the item's texture string later also doesn't work.
-
How to change the config file from within the code
Here's some working code that I use Property cw = config.get("WorldGen","dimensionWhitelistList", new int[] {0}); Property cb = config.get("WorldGen","dimensionBlacklistList", new int[] {-1,1}); int[] white = cw.getIntList(); int[] black = cb.getIntList(); Arrays.sort(white); Arrays.sort(black); String a=Arrays.toString(white); String whitestring[]=a.substring(1,a.length()-1).split(", "); String b=Arrays.toString(black); String blackstring[]=b.substring(1,b.length()-1).split(", "); cw.set(whitestring); cb.set(blackstring); It sorts two lists of dimensions so that they're in numerical order.
-
[1.6.4] - .setBlock problem
1) get passed a reference to it 2) DimensionManager.getWorld(id)
-
[1.6.4] Detecting player's item's enchantments
1) Get a reference to the player 1) player.getCurrentEquippedItem().stackTagCompound.getTagList("ench")
-
[1.6.4] Can't get textures to work with my mod
Nope. mOXkIe.zip |__modname |__assets
-
[1.7.2] Texturing block sides seperately!
Or look at the source for an old version of Minecraft.
-
How to change the config file from within the code
Configuration config = new Configuration(some_file_reference);//you'll have to figure this out for yourself config.get(Configuration.CATEGORY_GENERAL, "Enable this mod?", true).set(false);
-
[1.6.4] - .setBlock problem
Except that this is bad practice. IIRC, this will fail on the dedicated server side.
-
[1.5.2]A mod tried to open a gui on the server without being a network mod
No: TileEntity tileEntity = player.worldObj.getBlockTileEntity((int)player.posX, (int)player.posY, (int)player.posZ); Your tileEntity is null. Because there's no tile entity AT that location. This has been your problem from the beginning. There is not, will not, never has been a tile entity at the player's feet because THERE IS NO ENTITY THERE so stop trying to reference it. You get a crash on that line because null does not have an xCoord value.
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
Start printing out values and checking them against what the values should be. I can't help you debug your code, I can only tell you what you need to use.
-
[1.7.2] Unable to find any way to install forge on IntelliJ IDEA 13.0
There is a good installer. For Eclipse. You're off using InteliJ which is not actually supported by the Forge team, so you really don't have any grounds to complain.
-
[1.6.4] Flickering transparency using GL11.GL_BLEND
Unfortunately I am not sure at this point.
-
1.6.4 Limiting spawning of Custom Mob
The world class can do all of that. world.getEntitiesInAABB() for instance.
-
[1.5.2]A mod tried to open a gui on the server without being a network mod
...Really. A new tile entity. No no no no. You have a tile entity somewhere that is involved. Generally when the player right clicks it is when you open a gui for it. That method is inside a tile entity and has reference to itself. Unfortunately with the code you have supplied I'm not sure you even HAVE a tile entity anywhere. So I don't know why you're trying to reference it at all.
-
Client-server tileentity syncronisation
Packets are tiny as mouseballs. I have an addon mod for Mystcraft that sends four max-sized packets to the server (and later retrieves them) and the delay is pretty small. I mean, it's large enough to be noticed, but there's also a lot that goes on in order to retrieve the info. Basically I'm saving and retrieving screen renders from the player. The upper right corner is just a black box normally. http://s23.postimg.org/4az5t711n/2013_11_08_22_23_39.png[/img] The retrieval takes about 1 second (even with the client and server on the same machine), so I suspect it's mostly due to disk IO.
-
1.6.4 Limiting spawning of Custom Mob
this.worldObj
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
Its been a while since I messed around with collission boxes. Play around with it and see what it's doing.
-
Client-server tileentity syncronisation
Admittedly I haven't actually tried that, for whatever reason my PC can't handle two clients and a server simultaneously.
-
Client-server tileentity syncronisation
Nope. You don't need to manually do anything. I use it for a chest-like object that displays its contents as part of the renderer. There are some that generate as part of worldgen (so nothing involved clientside) and the item is already being displayed when I come across it.
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
x + this.minX --> this.minX ?
-
Client-server tileentity syncronisation
public Packet getDescriptionPacket() { NBTTagCompound nbtTag = new NBTTagCompound(); this.writeToNBT(nbtTag); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag); } public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) { readFromNBT(packet.data); }
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
Well your collision boxes for cases 0 and 2 are still only 1x1x1 in size, as xMin and xMax (ditty y and z) are based on block bounds, which ranges from 0...to 1. That and I think the x/y/z location is included. Meaning you're creating a collision box off in the middle of nowhere.
-
External Data Files & Ideas on How to Set Up Xp System & Other Stuff
Don't use config files, there's better ways to do it. 1) Use the player's already existent entityData. This is an NBT tag that all entities have that you can read and write any information you want to, to it and it will be saved in the user's profile, just like their inventory. 2) Use separate NBT data files. More difficult, but certainly doable. I did this for one mod because the data was per-world based, but tended to be "massive" in size, so having it remain loaded in memory all the time was not good, so the per-world storage that's given by IExtendedProperties wasn't going to work. Basically create a file reference and then run the file through CompressedStreamTools.
IPS spam blocked by CleanTalk.