• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Also, the texture doesn't glitch when the dust is in a straight line, or when it's in its dot form (not the '+' shape).
    • Unfortunately, that didn't work, it still glitches. Any other ideas?
    • I have something like that here is the similar code I wrote  package com.vicken.mod3.items; import com.vicken.mod3.util.RegistryHandler; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.Enchantments; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.projectile.AbstractArrowEntity; import net.minecraft.item.ArrowItem; import net.minecraft.item.BowItem; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.stats.Stats; import net.minecraft.tags.ItemTags; import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundEvents; import net.minecraft.world.World; import java.util.function.Predicate; public class ModBow extends BowItem { public ModBow(Properties builder) { super(builder); } public void onPlayerStoppedUsing(ItemStack bowStack, World worldIn, LivingEntity entityLiving, int timeLeft) { if (entityLiving instanceof PlayerEntity) { PlayerEntity playerentity = (PlayerEntity)entityLiving; boolean hasInfinity = playerentity.abilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantments.INFINITY, bowStack) > 0; ItemStack ammoStack = playerentity.findAmmo(bowStack); int timeDrawn = this.getUseDuration(bowStack) - timeLeft; timeDrawn = net.minecraftforge.event.ForgeEventFactory.onArrowLoose(bowStack, worldIn, playerentity, timeDrawn, !ammoStack.isEmpty() || hasInfinity); if (timeDrawn < 0) return; if (!ammoStack.isEmpty() || hasInfinity) { boolean isTippedArrow = ammoStack.getItem() == RegistryHandler.BULLET.get() || ammoStack.getItem() == RegistryHandler.BULLET.get(); if (ammoStack.isEmpty()) { ammoStack = new ItemStack(RegistryHandler.BULLET.get()); } float velocity = getArrowVelocity(timeDrawn); if (!((double)velocity < 100.1D)) { if (!worldIn.isRemote) { AbstractArrowEntity arrowEntity = createArrow(worldIn, ammoStack, playerentity); arrowEntity.shoot(playerentity, playerentity.rotationPitch, playerentity.rotationYaw, 0.0F, velocity * 100.0F, 0.0F); if (velocity == 1000.0F) arrowEntity.setIsCritical(true); double damage = getArrowDamage(bowStack, arrowEntity); arrowEntity.setDamage(damage); int knockback = getArrowKnockback(bowStack, arrowEntity); arrowEntity.setKnockbackStrength(knockback); // apply flame enchant if (EnchantmentHelper.getEnchantmentLevel(Enchantments.FLAME, bowStack) > 0) { arrowEntity.setFire(100); } // reduce bow durability bowStack.damageItem(1, playerentity, (p_220009_1_) -> { p_220009_1_.sendBreakAnimation(playerentity.getActiveHand()); }); // set if arrow can be picked up from ground if (hasInfinity && !isTippedArrow) { arrowEntity.pickupStatus = AbstractArrowEntity.PickupStatus.DISALLOWED; } // actually make the arrow entity exist in the world worldIn.addEntity(arrowEntity); } // sound worldIn.playSound((PlayerEntity)null, playerentity.getPosX(), playerentity.getPosY(), playerentity.getPosZ(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 1.2F) + velocity * 100.5F); // use an arrow boolean shouldConsumeArrow = !hasInfinity || isTippedArrow; if (shouldConsumeArrow) { ammoStack.shrink(1); if (ammoStack.isEmpty()) { playerentity.inventory.deleteStack(ammoStack); } } playerentity.addStat(Stats.ITEM_USED.get(this)); } } } } // override to use a custom arrow entity protected AbstractArrowEntity createArrow(World worldIn, ItemStack ammoStack, PlayerEntity playerentity) { ArrowItem arrowitem = (ArrowItem)(ammoStack.getItem() instanceof ArrowItem ? ammoStack.getItem() : RegistryHandler.BULLET.get()); return arrowitem.createArrow(worldIn, ammoStack, playerentity); } protected double getArrowDamage(ItemStack bowStack, AbstractArrowEntity arrowEntity) { int powerLevel = EnchantmentHelper.getEnchantmentLevel(Enchantments.POWER, bowStack); if (powerLevel > 0) return arrowEntity.getDamage() + (double)powerLevel * 100.5D + 0.5D; else return arrowEntity.getDamage(); } protected int getArrowKnockback(ItemStack bowStack, AbstractArrowEntity arrowEntity) { return EnchantmentHelper.getEnchantmentLevel(Enchantments.PUNCH, bowStack); } // Override to change what it uses as ammo public Predicate<ItemStack> getInventoryAmmoPredicate() { return (ammoStack) -> { return ammoStack.getItem() == RegistryHandler.BULLET.get(); }; } @Override public Predicate<ItemStack> getAmmoPredicate() { return (ammoStack) -> { return ammoStack.getItem() == RegistryHandler.BULLET.get(); }; } public static float getArrowVelocity(int charge) { float f = (float)charge / 100.0F; f = (f * f + f * 100.0F) / 100.0F; if (f > 100.0F) { f = 100.0F; } return f; } }
    • I was wondering how to create a Custom Atlas Texture and how to register it, I'm trying to create a custom rendering system and wanted to load all the textures into an atlas of my own, how would I go about creating an atlas, and registering it?
    • Hello. I have a problem with chisels and bits mod. I play 1.12.2 with mod version 14.33 and when i break a Chiseled Block my game just crashes. This is a crash report:   Description: Unexpected error java.lang.NullPointerException: Unexpected error     at mod.chiselsandbits.client.CreativeClipboardTab.addItem(CreativeClipboardTab.java:58)     at mod.chiselsandbits.chiseledblock.BlockChiseled.removedByPlayer(BlockChiseled.java:153)     at net.minecraft.client.multiplayer.PlayerControllerMP.func_187103_a(PlayerControllerMP.java:176)     at net.minecraft.client.multiplayer.PlayerControllerMP.func_178891_a(PlayerControllerMP.java:74)     at net.minecraft.client.multiplayer.PlayerControllerMP.func_180511_b(PlayerControllerMP.java:223)     at net.optifine.override.PlayerControllerOF.func_180511_b(PlayerControllerOF.java:49)     at net.minecraft.client.Minecraft.func_147116_af(Minecraft.java:1518)     at net.minecraft.client.Minecraft.func_184117_aA(Minecraft.java:2249)     at net.minecraft.client.Minecraft.func_184118_az(Minecraft.java:2020)     at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1808)     at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1098)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398)     at net.minecraft.client.main.Main.main(SourceFile:123)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)     at java.lang.reflect.Method.invoke(Unknown Source)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28)    
  • Topics

  • Who's Online (See full list)