SapphireSky
Members-
Posts
73 -
Joined
-
Last visited
Everything posted by SapphireSky
-
What I'm trying to do is have a recipe with an item and materials based on the main item's NBT, that results in the original item with additional/changed NBT. For example, if Weapon(NO NBT) is in a recipe with MaterialOne, I want to add element tag Fire resulting in Weapon(Fire), or if Weapon(Fire) is in a recipe with MaterialTwo I want to remove the tag Fire resulting in Weapon(NO NBT). Or, if Weapon(Fire, Level1) is in a recipe with MaterialThree, I want to increase its Level tag so it becomes Weapon(Fire, Level2), etc. I've only figured out a way to do this WITHOUT NBT, but unfortunately that involves creating a new item and recipe for every possible combination of element and levels, which results in around 2000 model/recipe json files to be generated for each weapon, which is obviously a bad idea. What's the best way to actually DO this? This is all I've got so far, but I'm not sure if it's even right, much less where to go from here.
-
[1.12.2] Proper way of sending packets from a keybind?
SapphireSky replied to SapphireSky's topic in Modder Support
Well there's not exactly a way to do it without packets, is there? The changing-NBT one I feel would be used quite a lot, and while I don't want to spam packets I can't really think of a better way of doing it since something like just sneak-using the item seems really tacky... -
I get that you have to send a packet from the client to the server and I know how to make packets but I'm only used to server-to-client; I'm confused as to how to handle client-to-server. Like I want to have two keybinds: one that uses an item if it's in the player's inventory, and another that changes a held item's NBT data. Do I just need to send a packet on key press and perform the action within its scheduled task on the server? Or do I need to also have the action done client-side pre-sending packet?
-
[1.12.2] Help with custom entity rendering?
SapphireSky replied to SapphireSky's topic in Modder Support
The RenderManager was only there because of something else I was trying that didn't work; forgot to remove it. Also, changing it to this... still produces the same result. Renders a white cube instead of the item. Did I miss something? -
I'm trying to make an item that when thrown creates a pool of fire on impact, yet I'm confused how to get it to actually render. The entity functions as it should, and it renders fine in hand/inventory. But the entity itself just won't render. I see some people say to register entities from init() and some from preInit() so I tried both, each with negative results. If I call the registry in preInit() as soon as it's thrown and tries to render, the game crashes with a NullPointerException: But if I call the registry in init() instead of crashing, everything works perfectly except that it renders as just a small white cube. Any help? Entities: Registry: EntityFirebomb:
-
I'm seriously confused with this. I'm making a mod with a ridiculously large variety of weapons but for some reason only things with a custom model have a texture. Everything that uses the basic "handheld" or "generated" default item models have no texture. And I don't mean they have that square purple-and-black "missing texture" texture, I mean they are just invisible. I thought maybe because I was trying to use 32x32 textures (with an upscaled item model basically to make big-looking weapons without awful quality) and I'd never done above 24x24 before, but even switching back to 24x24 or even 16x16 or whether I use the scaled model or the default Vanilla one, they're still just invisible. The invisible textures have no transparency (though semi/transparency still works perfectly fine in some other custom-model items that DO show up and use it) and are made in RGB format in GIMP no differently from the thousand other times I've made working textures. Clearing cache and re-doing the workspace setup with gradle didn't help. All files are properly synced between the /src and /bin folders. I have no issue like this with any other project on 1.12.2 or any other version. So I'm completely clueless as to what's going on and I'm out of ideas to try.
-
I'm trying to make an item that transforms, changing its model, when it's used. But the model for some reason just won't load and of course the error couldn't be more vague so I can't figure it out myself. Any help would be appreciated.... Error: Base model: Untransformed model: Transformed model:
-
I made my own shield item and want it to replace the Vanilla one, so I'm just trying to at least remove the Vanilla recipe so the player can't get it. I'm trying this at the end of my FMLInitializationEvent... ForgeRegistry<IRecipe> recipeRegistry = (ForgeRegistry<IRecipe>) ForgeRegistries.RECIPES; for (IRecipe r : recipeRegistry.getValuesCollection()) { Item item = r.getRecipeOutput().getItem(); if (item == Items.SHIELD) { recipeRegistry.register(RecipeEdit.get(r)); } } ...but I'm getting this error that I've never experienced before: This is the RecipeEdit (fake recipe) class: What am I doing wrong?
-
I'm trying to make a mob (extends EntityMob) and am basically copying tasks from existing mobs, but EntityAINearestAttackableTarget is giving me warnings that it's generic. This is the default code, in any given mob class with a big yellow underline in Eclipse: this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, false)); this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true)); Yet if I apply the suggested fix, it doesn't show a warning: this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityVillager>(this, EntityVillager.class, false)); this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityIronGolem>(this, EntityIronGolem.class, true)); My question is, why? Why does it give me a warning if it's the Vanilla code that obviously works? Is it going to be problematic if I ignore the warning? Or if I fix the warning?
- 1 reply
-
- 1
-
Why can't I set up my workspace with gradle anymore??
SapphireSky replied to SapphireSky's topic in ForgeGradle
Yes. -
Why can't I set up my workspace with gradle anymore??
SapphireSky replied to SapphireSky's topic in ForgeGradle
jdk-8u181-windows-x64.exe -
Why can't I set up my workspace with gradle anymore??
SapphireSky replied to SapphireSky's topic in ForgeGradle
C:\Program Files\Java\jdk1.8.0_181 -
Why can't I set up my workspace with gradle anymore??
SapphireSky replied to SapphireSky's topic in ForgeGradle
Okay, just did that and restarted computer. Yet nothing has changed. -
Why can't I set up my workspace with gradle anymore??
SapphireSky replied to SapphireSky's topic in ForgeGradle
-
Why can't I set up my workspace with gradle anymore??
SapphireSky replied to SapphireSky's topic in ForgeGradle
Yep. I can code non-Minecraft Java perfectly fine, so nothing is wrong there. -
Why can't I set up my workspace with gradle anymore??
SapphireSky replied to SapphireSky's topic in ForgeGradle
Yes. -
Why can't I set up my workspace with gradle anymore??
SapphireSky replied to SapphireSky's topic in ForgeGradle
You mean this? C:\Program Files\Java\jdk1.8.0_181 -
Why can't I set up my workspace with gradle anymore??
SapphireSky replied to SapphireSky's topic in ForgeGradle
I am... -
I've done this a hundred times before (probably not even exaggerating) but after a long break I decided to get back into modding and now I can't even set up my workspace. Java is updated to the latest Java 8 version, which has always worked for me in the past. I have the latest recommended Forge for 1.12.2. Minecraft has downloaded and started up in 1.12.2, as well as with the Forge profile, in a completely new Minecraft installation (I had launcher troubles so I deleted everything). Yet when I use gradlew setupDecompWorkspace in the command prompt, it fails with the error: Could not reserve enough space for 3145728KB object heap. The gradle.properties file has the default 3G allocated (my computer has 8G total, nothing else is open, and only 36% is being used according to my Task Manager), and increasing it (either to 4G or to the exact amount of space it says it needs above) tells me it's an invalid heap size and it "exceeds the maximum representable size". How am I supposed to fix this?
-
I'm trying to make a generic method to more easily add a vein of ore to generation. But for some reason it's totally ignoring the block it's supposed to replace and filling the above-ground air with tons of randomly placed ores. From my understanding, using BlockStateMatcher.forBlock(block) as the last parameter in WorldGenMineable() is supposed to make it only generate in that block, instead of the default Stone, right? Well that's not working at all. So why is this happening? @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.getDimension()) { case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); break; } } private void generateSurface(World world, Random random, int blockX, int blockZ) { generateOre(world, random, blockX, blockZ, Registry.quickSilverOre, Blocks.STONE, 5, 60, 5, 4); generateOre(world, random, blockX, blockZ, Registry.bloodstoneOre, Blocks.GRAVEL, 5, 128, 12, 1); } private void generateOre(World world, Random random, int chunkX, int chunkY, Block oreToGenerate, Block blockToReplace, int minHeight, int maxHeight, int amountPerChunk, int veinSize) { for (int i = 0; i < amountPerChunk; i++) { int x = chunkX + random.nextInt(16); int y = minHeight + random.nextInt(maxHeight - minHeight); int z = chunkY + random.nextInt(16); world.setBlockState(new BlockPos(x, y, z), Registry.quickSilverOre.getDefaultState()); WorldGenMinable wg = new WorldGenMinable(oreToGenerate.getDefaultState(), veinSize, BlockStateMatcher.forBlock(blockToReplace)); wg.generate(world, random, new BlockPos(x, y, z)); } }
-
I'm trying to make a throwable item that renders like a snowball, but I haven't done any modding since 1.7.10 and have no idea what's going on now in 1.11. I can't find any tutorials/github code with a render class for a throwable entity, only mobs, and can't find where the render class is actually referred, to register the vanilla snowball for example, in the base code. So from what I've actually been able to find, and tell me if I'm wrong, but I believe this registers the entity: EntityRegistry.registerModEntity(null, EntityBomb.class, "Bomb", Main.entityIds++, Main.instance, 64, 20, true); But what is the resource location (where I have 'null', first parameter) supposed to be? And then I think this is what the render class should be: @SideOnly(Side.CLIENT) public class RenderItemBomb<T extends Entity> extends Render<T> { protected final Item item; private final String texture; public static RenderFactory factory; public RenderItemBomb(RenderManager renderManagerIn) { super(renderManagerIn); this.item = Registry.bomb; this.texture = "bomb"; this.factory = new RenderFactory(); } public static class RenderFactory implements IRenderFactory<EntityThrowable> { @Override public Render<? super EntityThrowable> createRenderFor(RenderManager manager) { return new RenderItemBomb(manager); } } public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks) { GlStateManager.pushMatrix(); GlStateManager.translate((float) x, (float) y, (float) z); GlStateManager.enableRescaleNormal(); GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GlStateManager.rotate( (float) (this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); this.bindTexture(getEntityTexture(entity)); if (this.renderOutlines) { GlStateManager.enableColorMaterial(); GlStateManager.enableOutlineMode(this.getTeamColor(entity)); } /** (?) **/ /** (?) **/ this.itemRenderer.renderItem(this.getStackToRender(entity), ItemCameraTransforms.TransformType.GROUND); /** (?) **/ /** (?) **/ if (this.renderOutlines) { GlStateManager.disableOutlineMode(); GlStateManager.disableColorMaterial(); } GlStateManager.disableRescaleNormal(); GlStateManager.popMatrix(); super.doRender(entity, x, y, z, entityYaw, partialTicks); } public ItemStack getStackToRender(T entityIn) { return new ItemStack(this.item); } protected ResourceLocation getEntityTexture(Entity entity) { return new ResourceLocation(Main.MODID, texture); } } But then that line in the middle I surrounded by question marks, where it grabs the item's renderer, how am I supposed to get that?