Everything posted by Choonster
-
[1.7.10] Problem giving player items on first join
If there's no compound tag at the specified key, NBTTagCompound#getCompoundTag will return a new one; but this new tag won't be added to the parent tag's map so you need to do this manually. I've written a basic example of this for 1.8.9 here. It should be mostly the same in earlier versions.
-
[1.8.9] [SOLVED] Registering a new mob entity?
For a method reference to be used as an interface, the method must have the same signature as the interface's method. IRenderFactory#createRenderFor takes a single RenderManager argument and returns a Render , your method must do the same. Constructors implicitly return an instance of their class, so you just need to match the arguments. You don't need to create your own renderManager field, Render#renderManager already exists with protected access.
-
[1.7.10] Problem giving player items on first join
That should work. If you look at the player's NBT data after login at runtime or in the save, is your key present? Post your new code on Gist or Pastebin with syntax highlighting and link it here.
-
Help me
Have you installed CodeChickenCore?
-
[1.8.9] [SOLVED] Registering a new mob entity?
The parentheses weren't part of the code. Just pass the method reference itself as the IRenderFactory argument, you don't need to explicitly cast to or specify that it's an IRenderFactory . registerEntityRenderingHandler(EntityNewMob.class, RenderNewMob::new);
-
[1.8.9] [SOLVED] Registering a new mob entity?
If you're targeting Java 6/7, just create an anonymous class that implements IRenderFactory and overrides createRenderFor to return a new instance of the your Render class. If you're targeting Java 8, you can use a method reference to pass your Render class's constructor ( RenderMyEntity::new ) as an IRenderFactory instead.
-
[1.8.9] How to stop water breaking a crop?
BlockDynamicLiquid#isBlocked controls whether or not a liquid can flow into an adjacent block. Liquids won't replace a block if it's a door, a standing sign, a ladder, sugar canes, uses Material.portal or a Material that returns true from Material#blocksMovement . In this case, you just need to use a Material that returns true from Material#blocksMovement . This can either be an existing one or your own.
-
[1.7.10]How to make an ore spawn in a specific biome
Once you've chosen a position to generate your ore at, you can use World#getBiomeGenForCoords to check the biome at that position. If it's the right biome, generate your ore; otherwise do nothing.
-
[1.7.10]connect to server
Did you try calling FMLClientHandler#connectToServer with a new ServerData object?
-
Minecraft 1.8 Structure Generation Help
So would it be : Block checkID = world.setBlockState(new BlockPos(i, j, k), IBlockState.getBlock, checkID); I simply cant figure it out. IBlockState#getBlock means that getBlock is an instance method of IBlockState . Call it on an instance of IBlockState to get its Block . Use World#getBlockState to get the IBlockState at the specified position. You can think of an IBlockState as a combination of a Block and its metadata value. Use GameRegistry.registerWorldGenerator to register an IWorldGenerator .
-
[1.7.10]How to make an ore not spawn in a custom dimension
Vanilla ores (and most Overworld mod ores) only generate in Stone, so you can use a different terrain block by overriding BiomeGenBase#genTerrainBlocks . You could also override BiomeGenBase#createBiomeDecorator to return a BiomeDecorator that overrides BiomeDecorator#generateOres to not generate any vanilla ores. This won't affect mod ores, though.
-
[1.7.10] Problem giving player items on first join
The compound tag returned by Entity#getEntityData is persisted through saves, but it's not copied when the player respawns ( EntityPlayer#clonePlayer ). Only the data in the EntityPlayer.PERSISTED_NBT_TAG sub-compound of Entity#getEntityData is copied over when the player respawns.
-
[1.8.9] "Universal" Entity
Call the super method from EntitySpectral#onLivingUpdate . If you override a method (especially one that updates stuff), you'll usually want to call the super method. You have a lot of overridden methods not calling their super methods.
-
[1.7.10] What's wrong with my recipes?
One of your ingredients is either null or not a Block / Item / ItemStack . Put a breakpoint on line 225 of CraftingManager (where the HashMap of ingredients is populated) with a condition of itemStack1 == null and see what the value p_92103_2_[i + 1] is.
-
[1.8.9] "Universal" Entity
You're writing the NBT correctly, but this.entity will be null on the client, so you can't call Entity#deserializeNBT on it. You need to use EntityList.createEntityFromNBT instead, which creates the entity and then reads it from NBT. I just realised that Entity#writeToNBT doesn't save the entity's string ID, which is needed to recreate it from NBT. Use Entity#serializeNBT instead, which does save the ID.
-
Minecraft 1.8 Structure Generation Help
An IBlockState will never be equal to an int . Use IBlockState#getBlock to get the Block represented by an IBlockState . There's no method called World#setDefaultState . World#setBlockState is the method you want.
-
[1.7.10] What's wrong with my recipes?
I suspect that either Content.kingdom_key or Content.heart are null at the time of this method being called. Use the debugger to step through this method and figure out what's null . Make sure you initialise all of your items in preInit, then add recipes in init.
-
[1.8.9] "Universal" Entity
You should probably call the super methods in your overrides of Entity#readEntityFromNBT and Entity#writeEntityToNBT , but I don't think that's the cause of the issue here. I suspect the issue is that the server has a reference to the original entity when the spectral entity is first spawned and when it's read from NBT, but the client doesn't know anything about it. If you want to sync data from the server to the client when an entity is spawned in the world, you can implement IEntityAdditionalSpawnData in your Entity class. I suggest you use this to send the NBT serialised entity from the server to the client, then deserialise it back into an entity on the client side.
-
ISM Crash
The crash report is the same as before, so it probably wasn't OptiFine screwing things up. I'm not too sure what's causing the error, you should probably report it to the author of ISM.
-
[1.8.9] "Universal" Entity
You should be able to use EntityList#createEntityFromNBT to create an Entity from a compound tag that was previously written to by Entity#writeToNBT . The Entity#isDead field isn't persisted. It's also public, so you can just set it to false when the entity is first reanimated.
-
Forge crash at launch please help
The config directory will be in whatever directory Minecraft runs in, the same directory containing the mods directory. This may not be .minecraft. I don't fully understand what you're saying. What's not possible and why is it not possible?
-
ISM Crash
Try removing OptiFine. It may or may not fix the issue.
-
[1.8.9] "Universal" Entity
Call the dead entity Render 's methods from the corresponding methods of your Render , e.g. override Render#doRender to fetch the dead entity's Render and call doRender on it, passing the dead entity as an argument. It may be difficult to create a "spectral" effect works with any entity, since you can't know how that entity will be rendered. I don't know anything about OpenGL, so I can't help you there.
-
[1.8.9] Adding Additional Mods to Dev Environment
If you want to compile against them, either add them as dependencies in build.gradle (the easiest way to do things if the mod has a Maven/Ivy repository hosted somewhere) or create a libs directory next to build.gradle and put them in there. If you don't need to compile against them (e.g. you only need to do stuff via IMC), you can just put them in the mods directory like you would for normal Minecraft. Recent versions of Forge (1.8.9-11.15.0.1696 and newer) can load SRG named mods in the development environment, so you don't have to use dev/deobf versions.
-
[1.8] Custom Layer Render Problem
On the client there's only one World : Minecraft#theWorld .
IPS spam blocked by CleanTalk.