Jump to content

SapphireSky

Members
  • Posts

    73
  • Joined

  • Last visited

Everything posted by SapphireSky

  1. No, but I imported the project to set up the mod basics before attempting to add Baubles integration. Is refreshing dependencies and refreshing Eclipse's workspace not enough? Do I have to delete and re-import the project?
  2. I did everything I listed above, and I know it doesn't install any mods, but shouldn't adding the repositories/dependencies bit give me access to the API from my project? 'Cause unless I'm missing something else less obvious, I'm not getting any access to it from anywhere.
  3. I cannot for the life of me figure out how to do this. I'm trying to make a mod that uses Baubles (specifically Baubles Reborn since Baubles hasn't been updated since 1.12). Its official "how to" tells you to put these: repositories { maven { url 'https://jitpack.io' } } dependencies { compile 'com.github.lazyMods:Baubles:1.8.7-1.16.5:api' } in the build.gradle file... but ends there with no other instructions. I've tried looking at other (old) posts about and implementations of Baubles, and the only other things I can find to is adding this: [[dependencies.zero]] modId="baubles" mandatory=true versionRange="[1.8.7,)" ordering="NONE" side="BOTH" into my mods.toml file, as well as using the --refresh-dependencies gradle command. Nothing has given me any errors, but nothing is referencing anything to do with Baubles, either. What am I supposed to ACTUALLY do to get this to work?
  4. I'm trying to make a custom model for a piece of armour, but am having trouble. The code that Blockbench exports either uses old mappings, the unofficial (or unofficial?) mappings (my project is using whatever is default), or both. I can't tell. . I tried updating the exported code to what I assume is the proper equivalent in my case, but ModelRenderer::setRotationPoint(x,y,z) doesn't seem to have any alternative. The closest thing I can see that affects rotations at all is ModelRenderer::translateAndRotate(matrixstack), but I can't figure out how to use that, much less if that's even the right option to use. . This is the exported code vs my attempt at fixing it, in case I did something else wrong as well, I'm going off older tutorials and Google here..: Exported model class with wrong mappings: My attempt at fixing them, my problematic methods commented: I don't suppose there's any way to make this so much less work and just use standard JSON item models as armour instead...?
  5. I'm trying to render overlay textures to replace the player HUD, but for some reason the transparency is being displayed as opaque. I didn't have to do anything special to make it work in 1.12.2, but did that change? I can't find anything in IngameGui around where it renders the hotbar to affect transparency, so I don't understand why it's not working. This is what it's supposed to look like (with transparency) vs what it looks like in game (without transparency).
  6. Then why do all tutorials on capabilities I've seen have it done in the PlayerEvent.Clone event? PlayerEvent.Clone is also how the Forge documentation says to do it... Is that something that recently changed?
  7. I'm trying to save the player's death location to a capability so a custom compass will point there. Everything seems to work fine, and according to all my console print-outs the capability is being properly synced, but for some reason both the item's tooltip and compass point graphic will only point to the capability's default value of 0,0,0 (BlockPos.ORIGIN, just so it's never null). I don't understand why this isn't working. Capability/death events:
  8. This is what it looks like right now (top-right corner of image). It only faces north, but I want to rotate the radar so instead of facing north all the time it faces the direction the player is looking. For example, the player is facing west in the image and as you can see from the radar, the mobs on the screen don't like up. The second image below is what it should look like if the player is facing this direction, and it should rotate the same way no matter which direction the player is looking.
  9. I made a sonar-like entity radar that works fine, but it only faces north. That wouldn't be a problem if I was making a minimap, but for a radar telling the player which direction they're facing isn't good enough to let the player where exactly these entities are. I assume rotating it has something to do with comparing the player's look vector against the entity position, but that's an area I've just never been able to understand the math for. The best way I know how would be to check for each of the player's EnumFacing values and subtract or add my i and j variables accordingly, but that still only gives me 4 possible rotations which isn't what I'm trying to do... Can I get any help with this? private void renderRadar() { mc.getTextureManager().bindTexture(res); int x = screenwidth - 74; int y = 10; drawTexturedModalRect(x, y, 192, 188, 64, 68); float posx = x + 31.5f; float posy = y + 35.5f; drawTexturedModalRect(posx, posy, 234, 156, 1, 1); int k; for (Entity e : entitylist) { float i = (float) (e.posX - mc.player.posX); float j = (float) (e.posZ - mc.player.posZ); k = e instanceof EntityMob ? 231 : e instanceof EntityPlayer ? 234 : e instanceof EntityLiving ? 232 : e instanceof EntityItem ? 233 : 0; if (k > 0) { drawTexturedModalRect(posx + i, posy + j, k, 156, 1, 1); } } }
  10. But how do I figure out WHAT is creating that many entities? It's just a random assortment of all kinds of mobs, testing on a basic superflat world. I've only added a GUI and capabilities so far, not anything would affect or create mob spawns. It's not like there's a getWhyThisEntityWasCreated() method... And it's not like LivingSpawnEvent or EntityConstructing offer any source of creation either.
  11. I have two capabilities. One gives the player a number of different stats. The other allows living entities to store a list of all players that attacked it. The player one works perfectly fine. However, the attack list one is continuously causing never-ending console spam saying it's attaching a new capability. It prints the "Attaching capability" printout literally over a thousand times a second (one timestamp fills the entire Eclipse console). Why is it doing this and how can I make it stop? Attach event: @SubscribeEvent public void attachCapability(AttachCapabilitiesEvent<Entity> event) { // Works perfectly fine // (I assume; haven't tried on it in a world with more than one player) if (event.getObject() instanceof EntityPlayer) { System.out.println("[" + Main.MODID.toUpperCase() + "] ATTACHING STATS CAPABILITY."); event.addCapability(Main.STATS, new StatsManager()); } // Seems to work, but for some reason infinitely // spams the console with the following println command. // Tested in a superflat world with maybe 30 entities tops... if (event.getObject() instanceof EntityLivingBase) { System.out.println("[" + Main.MODID.toUpperCase() + "] ATTACHING ATTACK TRACKER CAPABILITY."); event.addCapability(Main.ATTACKERS, new AttackersManager()); } } Console spam:
  12. Ah okay, that makes a lot more sense now. Thanks.
  13. That's how I've always gotten it to work before... And I have it working that way in 1.14. Isn't Minecraft.getMinecraft().player literally "getting it from the game"? How else am I supposed to get the client player then?
  14. Oops, thought I included that up there. It's in the class, defined in constructor. private Minecraft mc; private EntityPlayer player; public PlayerHud() { mc = Minecraft.getMinecraft(); player = mc.player; //.... }
  15. This is driving me nuts and it's probably some stupid overlook. I've done this literally a dozen times but lost all my computer data so I can't check my old code. I'm trying to replace the vanilla HUD with my own, and I can remove the vanilla one just fine but for some reason as soon as I try to access the client player it tells me the player is null. Main event handler @SidedProxy(clientSide = "ww.souls.net.ClientProxy", serverSide = "ww.souls.net.ServerProxy") public static ServerProxy proxy; @EventHandler public void init(FMLInitializationEvent event) { proxy.init(); } Registering render event on client @SideOnly(Side.CLIENT) public class ClientProxy extends ServerProxy { @Override public void init() { MinecraftForge.EVENT_BUS.register(new PlayerHud()); } } Render event private void render() { //OpenGL stuff float health = player.getHealth() / mc.player.getMaxHealth(); // <- Crashes when first accessing 'null' player here float hunger = player.getFoodStats().getFoodLevel() / 20f; float exp = player.experience; mc.getTextureManager().bindTexture(res); ItemStack mainhand = player.getHeldItemMainhand(); ItemStack offhand = player.getHeldItemOffhand(); int y = screenheight - 100; int x = 20; drawTexturedModalRect(x, y, offhand.getCount() == 0 ? 0 : 46, 23, 22, 35); drawTexturedModalRect(x, y - 23, 23, 0, 22, 72); //OpenGL stuff } @SubscribeEvent public void onRender(RenderGameOverlayEvent.Pre event) { if (event.getType() == ElementType.ARMOR || event.getType() == ElementType.FOOD || event.getType() == ElementType.HEALTH || event.getType() == ElementType.HEALTHMOUNT || event.getType() == ElementType.HOTBAR || event.getType() == ElementType.JUMPBAR) { event.setCanceled(true); return; } if (event.getType() == ElementType.EXPERIENCE) { render(); renderEnemyHealth(); event.setCanceled(true); } }
  16. I'd like to create a stamina system (separate from hunger) that decreases when you swing a weapon or sprint, and otherwise refills over time. I figure the easiest way to do this would be create a capability for it, but at the same time I feel that's a terrible idea since I'd have to send a packet every tick it's refilling for every player. If a player is using and regenerating a lot of stamina all the time, that's what, a pretty constant 20 packets per second? Even if there's only one player that's a bit much, isn't it? Or am I thinking packets are more demanding than they actually are? Is there any better way of doing this?
  17. I'm trying to make the player have a different skin under certain conditions, but for some reason the render event just isn't firing and I don't understand why. The class is registered on the event bus exactly like another client-only class that renders an overlay perfectly fine, but this one is just not working. // In main class @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new Events()); // This works perfectly fine. proxy.init(event); // <-- This is the following method -v } // In ClientProxy public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new Overlay()); // <-- This works perfectly fine. MinecraftForge.EVENT_BUS.register(new RenderCustomPlayerEvent()); // <-- This does not work at all. } // RenderCustomPlayerEvent public static final RenderCustomPlayer renderer = new RenderCustomPlayer(Minecraft.getMinecraft().getRenderManager()); @SideOnly(Side.CLIENT) @SubscribeEvent public static void renderPlayer(RenderLivingEvent.Pre<AbstractClientPlayer> event) { Main.log("Render"); // <-- This is never even reached and functions as it should elsewhere. AbstractClientPlayer player = (AbstractClientPlayer) event.getEntity(); if (player.getCapability(SoulsProvider.SOULS, null).isHollow() || Tools.hasRing((EntityPlayer) event.getEntity(), Registry.dullring)) { event.setCanceled(true); renderer.doRender(player, player.posX, player.posY, player.posZ, player.rotationYaw, event.getPartialRenderTick()); } }
  18. THIS is what I was asking..... I did not know the creation and use of the recipe were handled separately.
  19. That still doesn't answer my question... HOW does the list know what to return if you're not telling it what to return? matches() is basically just roughly this: public boolean matches(InventoryCrafting inv, World world) { if(inv contains materialitem && inv contains mainitem) { ItemStack result = new ItemStack(mainitem); result.setNBTBasedOn(materialitem); return true; } return false; } while getRemainingItems() contains: public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) { NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>withSize(inv.getSizeInventory(), ItemStack.EMPTY); for (int i = 0; i < nonnulllist.size(); ++i) { ItemStack itemstack = inv.getStackInSlot(i); nonnulllist.set(i, ForgeHooks.getContainerItem(itemstack)); } return nonnulllist; } I'm still failing to see how getRemainingItems() either gets the ingredients or consumes them. Unless I'm supposed to add to and manually pick out the items from in getRemainingItems() ? In which case, that's not exactly obvious since that method for Fireworks or Dyed Armour doesn't do that either.
  20. I know but how do I tell it which items are actually used up during crafting? I can't find anything that actually determines which items should be removed and removes them.
  21. That's easier than I expected then. But now how exactly do I tell the IRecipe which items to be removed during crafting? Looking at RecipeFireworks, matches() just checks to see if the needed items are available and creates the result item. And getRemainingItems() seems relevant but doesn't check for any of the needed items, so I'm confused how that's done.
  22. So... something like this? { "recipes": { "weaponvariant": "avrye.soulsstuff.util.RecipeWeapon.Factory" } } How am I supposed to return an IRecipe in parse()? I can't find any implementations of IRecipeFactory in the code. All examples I can find use either outdated code or helper classes that just make things way more complicated than what I need... package avrye.soulsstuff.util; public class RecipeWeapon extends Impl<IRecipe> implements IRecipe { // ... public static class Factory implements IRecipeFactory { @Override public IRecipe parse(JsonContext context, JsonObject json) { //TODO ? return null; } } }
  23. Loops are exactly how I already did it, resulting in thousands of items that I wanted to avoid, therefore my wanting to use NBT instead. But I forgot IRecipe was a thing. I assume I could just use something similar to how RecipeFireworks does it? And the proper way to register it is this something like this? @SubscribeEvent public static void registerRecipes(Register<IRecipe> event) { event.getRegistry().register(new RecipeWeapon()); }
  24. That's exactly my point.... Your way would require: sword = new Sword(name, 0, none) sword1 = new Sword(name, 1, none) sword2 = new Sword(name, 2, none) sword3 = new Sword(name, 3, none) sword4 = new Sword(name, 4, none) firesword = new Sword(name, 0, fire) firesword1 = new Sword(name, 1, fire) firesword2 = new Sword(name, 2, fire) firesword3 = new Sword(name, 3, fire) firesword4 = new Sword(name, 4, fire) ...and so on, for 10 levels each with 8 different elements for each level on over 200 weapons I'm adding. That's 16,000 new items, which would then need about 100 recipes each to allow changing them to and from other variants. I want to create ONE of each weapon, and just add the level and element using NBT to save literally thousands of file creations and dozens of megabytes in total file size...
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.