Jump to content

Javisel

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by Javisel

  1. Biome Manager currently provides only one type of biome generation for overworld biomes, and that's land-mass biomes like Forests or Deserts. Give us more options to allow us to add biomes that generate like shores, or islands.
  2. I've made a mod which can apply attribute modifiers to wolves via special collars: https://www.curseforge.com/minecraft/mc-mods/enchanted-wolves I've run into an issue where removing a collar doesn't update the current health to match the new max health. Adding a collar doesn't update the health either, and restarting the world resets the current health to the original max health. All other modifiers are functional, it seems to be just the Health modifier. Is this a mc/forge bug or am i doing something wrong? How could I fix this? Code: https://github.com/Javisel/EnchantedWolves
  3. ah, dumb mistake. It works now. thanks.
  4. Here it is. ForgeForums wouldn't let me post more then two links, sorry I lower cased it to perfectly match it's registry name and it still doesn't function. Same error.
  5. Due to the recommendations of some modders on the Modded Minecraft discord i've moved from initializing my items and blocks in class to making Object Holders and initializing them in Registration. After this change however, any block with an IProperty that has getDefaultState invoked will produce a nullpointerexception and I have no idea why. Currently I have a workaround by initializing them in class again but this defeats the purpose of moving to object holders. Example Crash ` Block Registration Class
  6. I tried it. It works! Thank you!
  7. I'll try these suggestions, thank you
  8. Oh, my bad. What about Sweeping Edge? The sweep effect is only activated when the swing was done with full strength. I took a look at the code for it in EntityPlayer and couldn't really understand it or replicate it's effects. Is it impossible to do so?
  9. Do you think it'd be possible to use getCooldownPeriod() somehow? I've tried but that hasn't worked. So i'm wondering if my implementation is incorrect and if there's a better way
  10. I've tried both numbers and it won't work. I'm trying to figure out if it was swung with 1.0F power, not if it is currently at 0.5f or 1.0F power.
  11. Sorry my bad. Here's a link to the item: Link
  12. I tried that, but it didn't work.
  13. I'm overriding the HityEntity method in Item to do something for the player. But for design choices/balancing I need to gate it behind weapon charge time. I'm trying to figure out how I can detect if an attack was done with full power to prevent spam clicking. I tried looking into EntityPlayer's and how it handles sweeping edge but I don't really understand it. Project Source Code
  14. Per the recommendations of someone on the Minecraft Mod Development Discord, I renamed my files to match java naming convention. While doing so I decided to test the game to see if anything broke, and lo and behold it did. I'm getting a FileNotFoundException for ClientProxy, but all the imports are correct. So what gives? I'm using IntelliJ IDEA as my IDE. crash-2019-07-15_00.15.04-client.txt Source Code
  15. I'm at a loss, I don't know how to fix this error. I'm creating a custom model for my block through Json. I used blockbench json editor to do it. But when i get in game the block has no texture or custom model. Console Output Json File { "forge_marker": 1, "credit": "Made with Blockbench", "textures": { "2": "blocks/gold", "3": "blocks/glass", "quartz_block_side": "blocks/quartz", "trappedmoon": "blocks/trappedmoon" }, "elements": [ { "name": "bottom", "from": [0, 0, 0], "to": [16, 1, 16], "faces": { "north": {"uv": [0, 0, 16, 1], "texture": "#2"}, "east": {"uv": [0, 0, 16, 1], "texture": "#2"}, "south": {"uv": [0, 0, 16, 1], "texture": "#2"}, "west": {"uv": [0, 0, 16, 1], "texture": "#2"}, "up": {"uv": [0, 0, 16, 16], "texture": "#quartz_block_side"}, "down": {"uv": [0, 0, 16, 16], "texture": "#2"} } }, { "name": "top", "from": [0, 15, 0], "to": [16, 16, 16], "faces": { "north": {"uv": [0, 0, 16, 1], "texture": "#2"}, "east": {"uv": [0, 0, 16, 1], "texture": "#2"}, "south": {"uv": [0, 0, 16, 1], "texture": "#2"}, "west": {"uv": [0, 0, 16, 1], "texture": "#2"}, "up": {"uv": [0, 0, 16, 16], "texture": "#2"}, "down": {"uv": [0, 0, 16, 16], "texture": "#quartz_block_side"} } }, { "name": "northwestpillar", "from": [0, 1, 0], "to": [1, 15, 1], "faces": { "north": {"uv": [0, 0, 1, 14], "texture": "#2"}, "east": {"uv": [0, 0, 1, 14], "texture": "#2"}, "south": {"uv": [0, 0, 1, 14], "texture": "#2"}, "west": {"uv": [0, 0, 1, 14], "texture": "#2"}, "up": {"uv": [0, 0, 1, 14], "texture": "#2"}, "down": {"uv": [0, 0, 1, 14], "texture": "#2"} } }, { "name": "northeastpillar", "from": [15, 1, 0], "to": [16, 15, 1], "faces": { "north": {"uv": [0, 0, 1, 14], "texture": "#2"}, "east": {"uv": [0, 0, 1, 14], "texture": "#2"}, "south": {"uv": [0, 0, 1, 14], "texture": "#2"}, "west": {"uv": [0, 0, 1, 14], "texture": "#2"}, "up": {"uv": [0, 0, 1, 14], "texture": "#2"}, "down": {"uv": [0, 0, 1, 14], "texture": "#2"} } }, { "name": "southeastpillar", "from": [15, 1, 15], "to": [16, 15, 16], "faces": { "north": {"uv": [0, 0, 1, 14], "texture": "#2"}, "east": {"uv": [0, 0, 1, 14], "texture": "#2"}, "south": {"uv": [0, 0, 1, 14], "texture": "#2"}, "west": {"uv": [0, 0, 1, 14], "texture": "#2"}, "up": {"uv": [0, 0, 1, 14], "texture": "#2"}, "down": {"uv": [0, 0, 1, 14], "texture": "#2"} } }, { "name": "soutwestpillar", "from": [0, 1, 15], "to": [1, 15, 16], "faces": { "north": {"uv": [0, 0, 1, 14], "texture": "#2"}, "east": {"uv": [0, 0, 1, 14], "texture": "#2"}, "south": {"uv": [0, 0, 1, 14], "texture": "#2"}, "west": {"uv": [0, 0, 1, 14], "texture": "#2"}, "up": {"uv": [0, 0, 1, 14], "texture": "#2"}, "down": {"uv": [0, 0, 1, 14], "texture": "#2"} } }, { "name": "westglasswall", "from": [0, 1, 1], "to": [1, 15, 15], "faces": { "north": {"uv": [0, 0, 14, 14], "texture": "#3"}, "east": {"uv": [0, 0, 14, 14], "texture": "#3"}, "south": {"uv": [0, 0, 14, 14], "texture": "#3"}, "west": {"uv": [0, 0, 14, 14], "texture": "#3"}, "up": {"uv": [0, 0, 14, 14], "texture": "#3"}, "down": {"uv": [0, 0, 14, 14], "texture": "#3"} } }, { "name": "trappedmoon", "from": [6, 6, 6], "to": [10, 10, 10], "faces": { "north": {"uv": [0, 0, 4, 4], "texture": "#trappedmoon"}, "east": {"uv": [0, 0, 4, 4], "texture": "#trappedmoon"}, "south": {"uv": [0, 0, 4, 4], "texture": "#trappedmoon"}, "west": {"uv": [0, 0, 4, 4], "texture": "#trappedmoon"}, "up": {"uv": [0, 0, 4, 4], "texture": "#trappedmoon"}, "down": {"uv": [0, 0, 4, 4], "texture": "#trappedmoon"} } }, { "name": "northglasswall", "from": [1, 1, 0], "to": [15, 15, 1], "faces": { "north": {"uv": [0, 0, 14, 14], "texture": "#3"}, "east": {"uv": [0, 0, 14, 14], "texture": "#3"}, "south": {"uv": [0, 0, 14, 14], "texture": "#3"}, "west": {"uv": [0, 0, 14, 14], "texture": "#3"}, "up": {"uv": [0, 0, 14, 14], "texture": "#3"}, "down": {"uv": [0, 0, 14, 14], "texture": "#3"} } }, { "name": "southglasswall", "from": [1, 1, 15], "to": [15, 15, 16], "faces": { "north": {"uv": [0, 0, 14, 14], "texture": "#3"}, "east": {"uv": [0, 0, 14, 14], "texture": "#3"}, "south": {"uv": [0, 0, 14, 14], "texture": "#3"}, "west": {"uv": [0, 0, 14, 14], "texture": "#3"}, "up": {"uv": [0, 0, 14, 14], "texture": "#3"}, "down": {"uv": [0, 0, 14, 14], "texture": "#3"} } }, { "name": "eastglasswall", "from": [15, 1, 1], "to": [16, 15, 15], "faces": { "north": {"uv": [0, 0, 14, 14], "texture": "#3"}, "east": {"uv": [0, 0, 14, 14], "texture": "#3"}, "south": {"uv": [0, 0, 14, 14], "texture": "#3"}, "west": {"uv": [0, 0, 14, 14], "texture": "#3"}, "up": {"uv": [0, 0, 14, 14], "texture": "#3"}, "down": {"uv": [0, 0, 14, 14], "texture": "#3"} } } ], "display": { "thirdperson_righthand": { "rotation": [75, 315, 0], "translation": [0, 2.5, 0], "scale": [0.375, 0.375, 0.375] }, "firstperson_righthand": { "rotation": [0, 315, 0], "translation": [0, 2.5, 0], "scale": [0.4, 0.4, 0.4] }, "ground": { "translation": [0, 3, 0], "scale": [0.25, 0.25, 0.25] }, "gui": { "rotation": [30, 45, 0], "scale": [0.625, 0.625, 0.625] }, "head": { "rotation": [0, 180, 0] }, "fixed": { "rotation": [0, 180, 0] } }, "groups": [ { "name": "light_nexus", "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] } ], "variants": { "normal": { "model": "cube_all" }, "inventory": { "model": "cube_all" } } } Here's what it should look like. What am i doing wrong?
  16. I'm trying to add a new hud element that represents data in a players capability. That works fine, but existing HUD elements break with my additions. At first, the health bar, hunger bar and exp bar where screwed Source Code But after adding .post to all the events i managed to fix it somewhat. But now i'm stuck. It's just the hunger bar which is broken now. I tried adding m.renderEngine.bindTexture(Gui.ICONS) but it didn't fix it. Source Code package com.javisel.gui.bar.mana; import com.google.common.graph.ElementOrder.Type; import com.javisel.main.References; import com.javisel.main.Utilities; import com.javisel.resourcesystems.EnergyProvider; import com.javisel.resourcesystems.ManaProvider; import com.javisel.resourcesystems.Resources; import com.javisel.resourcesystems.SoulsProvider; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; public class AOGGUI extends Gui { private final ResourceLocation mana = new ResourceLocation(References.MODID, "textures/gui/manabar.png"); private final ResourceLocation energy = new ResourceLocation(References.MODID, "textures/gui/energybar.png"); private final ResourceLocation soul = new ResourceLocation(References.MODID, "textures/gui/soulcounter.png"); private final int tex_width = 100, tex_height = 10, barwidth = 98, barheight = 8, soulcounterwidth = 30, soulcounterheight = 30; int ticks = 0; private Resources usingResource = Resources.MANA; @SubscribeEvent(priority = EventPriority.NORMAL) public void RenderManaBar(RenderGameOverlayEvent.Post e) { Minecraft m = Minecraft.getMinecraft(); if (e.getType() == ElementType.TEXT) { float manaratio = m.player.getCapability(ManaProvider.Mana_CAP, null).getmana() / m.player.getCapability(ManaProvider.Mana_CAP, null).getmaxmana(); int currentWidth = (int) (barwidth * manaratio); if (Utilities.displayingresource(m.player) == Resources.MANA) { usingResource = Resources.MANA; m.renderEngine.bindTexture(mana); drawTexturedModalRect(0, 0, 0, 0, tex_width, tex_height); drawTexturedModalRect(1, 0, 1, tex_height, currentWidth, tex_height); drawCenteredString(m.fontRenderer, Math.round(m.player.getCapability(ManaProvider.Mana_CAP, null).getmana()) + "/" + Math.round(m.player.getCapability(ManaProvider.Mana_CAP, null).getmaxmana()), tex_width / 2, 1, Integer.parseInt("ffffff", 16)); m.renderEngine.bindTexture(Gui.ICONS); } } } @SubscribeEvent(priority = EventPriority.NORMAL) public void RenderEnergyBar(RenderGameOverlayEvent.Post e) { Minecraft m = Minecraft.getMinecraft(); if (e.getType() == ElementType.TEXT) { float energyratio = m.player.getCapability(EnergyProvider.Energy_CAP, null).getEnergy() / m.player.getCapability(EnergyProvider.Energy_CAP, null).getmaxEnergy(); int currentWidth = (int) (barwidth * energyratio); if (Utilities.displayingresource(m.player) == Resources.ENERGY) { usingResource = Resources.ENERGY; m.renderEngine.bindTexture(energy); drawTexturedModalRect(0, 0, 0, 0, tex_width, tex_height); drawTexturedModalRect(1, 0, 1, tex_height, currentWidth, tex_height); drawCenteredString(m.fontRenderer, Math.round(m.player.getCapability(EnergyProvider.Energy_CAP, null).getEnergy()) + "/" + Math.round(m.player.getCapability(EnergyProvider.Energy_CAP, null).getmaxEnergy()), tex_width / 2, 1, Integer.parseInt("ffffff", 16)); m.renderEngine.bindTexture(Gui.ICONS); } } } @SubscribeEvent(priority = EventPriority.NORMAL) public void RenderSoulCounter(RenderGameOverlayEvent.Post e) { Minecraft m = Minecraft.getMinecraft(); m.renderEngine.bindTexture(soul); if (e.getType() == ElementType.TEXT) { drawTexturedModalRect(0, tex_height + 1, 0, 0, soulcounterwidth, soulcounterheight); drawCenteredString(m.fontRenderer, Integer.toString(Math.round(m.player.getCapability(SoulsProvider.Souls_CAP, null).getSouls())), soulcounterwidth / 2, soulcounterheight + 1, Integer.parseInt("ffffff", 16)); m.renderEngine.bindTexture(Gui.ICONS); } } @SubscribeEvent(priority = EventPriority.NORMAL) public void RenderSoulCounterText(RenderGameOverlayEvent.Post e) { Minecraft m = Minecraft.getMinecraft(); m.renderEngine.bindTexture(soul); if (e.getType() == ElementType.TEXT) { drawCenteredString(m.fontRenderer, Integer.toString(Math.round(m.player.getCapability(SoulsProvider.Souls_CAP, null).getSouls())), soulcounterwidth / 2, soulcounterheight + 1, Integer.parseInt("ffffff", 16)); m.renderEngine.bindTexture(Gui.ICONS); } } } Any idea as to what's going wrong?
  17. I'm stepping through the debugger and can't figure out what's wrong. If i set the MaxDamage to a lower value (100) it works fine. But a value like 168000 breaks it.
  18. I've made a LivingHurtEvent that checks if the player is under a certain health threshold, and then checks if they have a specific undamaged item. The Event will then damage the item and heal the player. The damaged item uses OnUpdate to recover durability over time, simulating a cooldown effect. Problem is: it seems that the item is destroyed even if hasn't taken enough damage. Event Code @SubscribeEvent public void DevilContract(LivingHurtEvent e) { if (e.getEntityLiving() instanceof EntityPlayer) { EntityPlayer victim = (EntityPlayer) e.getEntityLiving(); ISouls Souls = victim.getCapability(SoulsProvider.Souls_CAP, null); ItemStack stack = ItemStack.EMPTY; if (victim.getHealth() <= (victim.getMaxHealth() * .50)) { if (victim.inventory.hasItemStack(new ItemStack(ModItems.DemonShield)) && Souls.getSouls() >= 100) { for (int i = 0; i < victim.inventory.getSizeInventory(); i++) { if (victim.inventory.getStackInSlot(i).getItem().equals(ModItems.DemonShield)) { stack = victim.inventory.getStackInSlot(i); if (stack.isItemDamaged()) { } else if (!stack.isItemDamaged()) { victim.heal(victim.getMaxHealth()); victim.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 50, 5)); victim.addPotionEffect(new PotionEffect(MobEffects.ABSORPTION, 50, 5)); Souls.consume(100); stack.damageItem(stack.getMaxDamage() - 1, victim); System.out.println("Item Damage: " + stack.getItemDamage()); } else { } } } } } } } Item Code package com.javisel.items; import java.util.List; import java.util.Random; import javax.annotation.Nullable; import com.javisel.resourcesystems.KaliModeProvider; import com.javisel.resourcesystems.PTKProvider; import com.javisel.resourcesystems.SoulsProvider; import net.minecraft.client.Minecraft; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.ItemElytra; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class DemonShield extends ItemBase { public DemonShield(String name) { super(name); this.setMaxStackSize(1); this.setMaxDamage(168000); // TODO Auto-generated constructor stub } @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) { EntityPlayer p = Minecraft.getMinecraft().player; tooltip.add("PASSIVE: Devil's Contract"); tooltip.add("Type: Stim"); tooltip.add("If you fall bellow 30% Health, you heal to full, gain resistance, absorption. 140 Minute Cooldown"); tooltip.add("Cost: 100 Souls"); if (stack.getItemDamage()!=0) { tooltip.add("Cooldown: " + ((stack.getItemDamage())/20)+"s"); } else { tooltip.add("Cooldown: Ready"); } if (p!=null) { tooltip.add("Souls: " + p.getCapability(SoulsProvider.Souls_CAP, null).getSouls()); } } @Override public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { if (stack.getItemDamage() != 0) { stack.setItemDamage(stack.getItemDamage()-1); } } }
×
×
  • Create New...

Important Information

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