Jump to content

aguinmox

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by aguinmox

  1. But which of the two is the most convenient if I just add an NBT or i should go for IIcon?
  2. Hey @coolAlias, is that possible to implement in the RenderBow.class i have?
  3. Hello Guys I was doing some stuff with my custom bow however Since this is a modelled one i use the animation at render of this bow. so the cycle like this - REST, START, HALF, FULL.. Now the problem is instead of being in the REST while not in use, i end up in the HALF i dont even know whats wrong with my code.. So please guys help me especially i want to finish this tonight.. Render Bow package mhfc.net.client.render.weapon.bow; import org.lwjgl.opengl.GL11; import mhfc.net.client.model.weapon.bow.ModelBHunters; import mhfc.net.common.util.lib.MHFCReference; import mhfc.net.common.weapon.range.bow.BHunters; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; public class RenderBHunters implements IItemRenderer { private ModelBHunters weapon; public RenderBHunters() { weapon = new ModelBHunters(); } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { int usingItem = 72000 - ((BHunters) item.getItem()).usingItem; switch (type) { case EQUIPPED : // render in third person float scale = 1.2f; GL11.glPushMatrix(); if (((Entity) data[1] instanceof EntityPlayer)&& (((EntityPlayer) data[1]).getCurrentEquippedItem() != null)) { if (usingItem < 5) { Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(MHFCReference.weapon_bow_hunters_tex_start)); } if ((usingItem >= 5) && (usingItem < 25)) { Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(MHFCReference.weapon_bow_hunters_tex_half)); } if (usingItem >= 25) { Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(MHFCReference.weapon_bow_hunters_tex_full)); } } else { Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(MHFCReference.weapon_bow_hunters_tex_rest)); } GL11.glRotatef(00F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(-90F, 0.0f, 1.0f, 0.0f); GL11.glRotatef(-180F, 0.0f, 0.0f, 1.0f); GL11.glTranslatef(-0.1F, -0.2F, -0.4F); GL11.glScalef(scale, scale, scale); weapon.renderA(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F,0.0625F); GL11.glPopMatrix(); break; case EQUIPPED_FIRST_PERSON : // rince and repeat the rendering. adjust axis' and translation // as needed GL11.glPushMatrix(); if (((Entity) data[1] instanceof EntityPlayer)&& (((EntityPlayer) data[1]).getCurrentEquippedItem() != null)) { if (usingItem < 5) { Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(MHFCReference.weapon_bow_hunters_tex_start)); } if ((usingItem >= 5) && (usingItem < 25)) { Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(MHFCReference.weapon_bow_hunters_tex_half)); } if (usingItem >= 25) { Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(MHFCReference.weapon_bow_hunters_tex_full)); } } else { Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(MHFCReference.weapon_bow_hunters_tex_rest)); } scale = 1.5f; GL11.glScalef(scale, scale, scale); GL11.glRotatef(0F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(-5F, 0.0f, 1.0f, 0.0f); GL11.glRotatef(-150F, 0.0f, 0.0f, 1.0f); //In to face or out, Up/Down , Left or Right <-- positive/negative GL11.glTranslatef(-1.1F, -0.6F, 0.5F); weapon.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; case ENTITY : GL11.glPushMatrix(); scale = 2.4F; GL11.glScalef(scale, scale, scale); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(MHFCReference.weapon_bow_hunters_tex_rest)); GL11.glRotatef(90F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(0F, 0.0f, 1.0f, 0.0f); GL11.glRotatef(45F, 0.0f, 0.0f, 1.0f); GL11.glTranslatef(0F, -0.6F, -0.1F); weapon.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; case INVENTORY : GL11.glPushMatrix(); scale = 1.0F; GL11.glScalef(scale, scale, scale); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(MHFCReference.weapon_bow_hunters_tex_rest)); GL11.glRotatef(200F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(-80F, 0.0f, 1.0f, 0.0f); GL11.glTranslatef(0.1F, -0.0F, -0.1F); // this is a method made by me in my model class to render only // the modelparts, without an entity argument, because in your // inventory, //the entity is always null. weapon.renderRest(0.0625F); GL11.glPopMatrix(); break; default : break; } } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { switch (type) { case INVENTORY : return true; default : break; } return false; } } package mhfc.net.common.weapon.range.bow; import java.util.List; import java.util.Random; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import mhfc.net.MHFCMain; import mhfc.net.common.helper.MHFCWeaponClassingHelper; import mhfc.net.common.system.ColorSystem; import mhfc.net.common.util.Cooldown; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Items; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; public class BowClass extends Item { public static final String[] ItemNameArray = new String[] { "bow","bow1", "bow2", "bow3" }; protected boolean poisontype, firetype, enableCooldownDisplay; protected String des1, des2, des3; // <--- Shorten the handles protected int attackdelay, rarity, meta, getcooldown; public int usingItem = 72000; @SideOnly(Side.CLIENT) public IIcon[] IconArray; public BowClass() { super(); getWeaponDescription(MHFCWeaponClassingHelper.bowname); this.maxStackSize = 1; this.setMaxDamage(1000); this.setCreativeTab(MHFCMain.mhfctabs); } public void elementalType(boolean poison, boolean fire) { poisontype = poison; firetype = fire; } @Deprecated // will rework soon public void getWeaponDescription(String title) { des1 = title; } public void getWeaponDescriptionWithMeta(String second, int rarerty, int metaData) { des2 = second; rarity = rarerty; meta = metaData; } public void getWeaponDescription(String second, int rareity) { des2 = second; rarity = rareity; } @Override @SuppressWarnings("unchecked") public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, @SuppressWarnings("rawtypes") List par3List, boolean par4) { par3List.add(ColorSystem.gold + des1); par3List.add(ColorSystem.dark_green + des2); par3List.add(ColorSystem.yellow + "Rarity: " + rarity); if (enableCooldownDisplay) Cooldown.displayAttackDelay(par1ItemStack, par3List, getcooldown); } @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { if (stack == usingItem) { if ((usingItem != null) && (usingItem.getItem() instanceof BowClass)) { if (useRemaining > 21) { return IconArray[3]; } else if (useRemaining > 14) { return IconArray[2]; } else if (useRemaining > 7) { return IconArray[1]; } } } return IconArray[0]; } @Override public IIcon getIconFromDamage(int par1) { return this.IconArray[0]; } /** * Return the enchantability factor of the item, most of the time is based * on material. */ @Override public int getItemEnchantability() { return -1; } @SideOnly(Side.CLIENT) public IIcon getItemIconForUseDuration(int par1) { return this.IconArray[par1]; } /** * returns the action that specifies what animation to play when the items * is being used */ @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.bow; } /** * How long it takes to use or consume an item */ @Override public int getMaxItemUseDuration(ItemStack par1ItemStack) { return 72000; } @Override public boolean getShareTag() { return true; } @Override public ItemStack onEaten(ItemStack par1ItemStack, World par2World,EntityPlayer par3EntityPlayer) { return par1ItemStack; } /** * Called whenever this item is equipped and the right mouse button is * pressed. Args: itemStack, world, entityPlayer */ @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,EntityPlayer player) { player.setItemInUse(par1ItemStack,this.getMaxItemUseDuration(par1ItemStack)); return par1ItemStack; } @Override public void onPlayerStoppedUsing(ItemStack stack, World par2World,EntityPlayer player, int par4) { super.onPlayerStoppedUsing(stack, par2World, player, par4); int maxItemUse = getMaxItemUseDuration(stack) - par4; boolean flag = (player.capabilities.isCreativeMode); if (player.inventory.hasItem(Items.arrow) || flag) { float f = maxItemUse / 20.0F; f = ((f * f) + (f * 2.0F)) / 3.0F; if (f < 0.5d) { return; } EntityArrow entityarrow = new EntityArrow(par2World,player, f * 2.0F); boolean crit = new Random().nextInt(10) == 0 ? true : false; entityarrow.setIsCritical(crit); if (f >= 1.0F && f <1.5F) { entityarrow.setIsCritical(true); } if (f > 1.0F) { f = 1.0F; } entityarrow.setDamage(entityarrow.getDamage()+ (flag ? 2D : 1D)); entityarrow.setKnockbackStrength(1); if (flag) { entityarrow.canBePickedUp = 2; } else { player.inventory.consumeInventoryItem(Items.arrow); } if (!par2World.isRemote) { par2World.spawnEntityInWorld(entityarrow); } stack.damageItem(1, player); par2World.playSoundAtEntity(player, "random.bow", 1.0F,(1.0F / ((itemRand.nextFloat() * 0.4F) + 1.2F))+ (f * 0.5F)); } } @Override public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { player.setItemInUse(stack, count); usingItem = count; } @Override public void registerIcons(IIconRegister par1IconRegister) { this.IconArray = new IIcon[itemNameArray.length]; for (int i = 0; i < this.IconArray.length; ++i) { String prefix = "mhfc:"; this.IconArray[i] = par1IconRegister.registerIcon(prefix+ ItemNameArray[i]); } this.itemIcon = this.IconArray[0]; } @Override public boolean requiresMultipleRenderPasses() { return false; } } P,S im done already registering my classes and so.
  4. Hello everyone im trying to understand how does cape detects the names in string on a html txt and heres is what i gone so far public static void capeList() throws Exception { int timeout = 30; String capeURL = "http://i.imgur.com/p0JW7NF.png"; URL capeListUrl = new URL("https://gist.githubusercontent.com/Bruce/e3f86194c43424abb8c4/raw/capes"); URLConnection connection = capeListUrl.openConnection(); connection.setConnectTimeout(timeout); connection.setReadTimeout(timeout); InputStream stream = connection.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); String line; while ((line = reader.readLine()) != null) { if(!line.isEmpty()){ String username = line.toLowerCase(); ThreadDownloadImageData image = new ThreadDownloadImageData(capeURL, null, null); Minecraft.getMinecraft().renderEngine.loadTexture(new ResourceLocation("cloaks/" + username), (ITextureObject) image); }else{ continue; } } } cape wont load to me character please help im newbie and willing to learn
  5. Hello everyone im working now on the speed of attack of the player a.k.a attack speed . I base it on potion digslowdown / mining fatigue i think. But due to bad luck searching i did not see anything how that slowdown occur. Anyhelp guys? Thankyou
  6. Ahh ok i get somehow it similar for the ones i had in wc3 modding , thanks
  7. Is random class makes like a probability and chances method ? like random.nextint(20) <---------- is 20 like 20 % chance or a loop between 1 - 20? thankyouu
  8. Cool event is good idea ,hehe whats with my mod
  9. Hello everyone so i just created a version checker for my own mod. and somehow i register it in my main class and it works(using system print) but one thing i wanna know is how do i make a chat message referring to the newversion. like on player login Me code anyway thankyou package mhfc.heltrato.common.helper.system; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; public class HentaiVersionHelper { public static String urlString; public static String versionString; public static String newVersionStr; public static int newUpdate = 2; public static int noUpdate = 1; public static int offline = 0; public static void init(String url, String version) { urlString = url; versionString = version; } public static int isUpdateAvailable() { try { BufferedReader versionFile = new BufferedReader(new InputStreamReader(new URL(urlString).openStream())); String curVersion = versionFile.readLine(); newVersionStr = curVersion; versionFile.close(); if (!curVersion.equals(versionString)) { return newUpdate; } else { return noUpdate; } } catch(Exception e) { return offline; } } }
  10. Ahh kinda get it now , does it also checks the units or entity within its dimension?
  11. i have a basic question because i have a little confuse on this im newbie anyway but willing to learn. Is AxisAlignedBB is about the radius or determines the area or is it just a x bounding box? i use 1.7.2 btw
  12. Hey just got home, but any other help or its done.
  13. Here . Sorry late reply [16:37:20] [main/INFO] [GradleStart]: Extra: [] [16:37:21] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/User/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --accessToken, {REDACTED}, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker] [16:37:21] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker [16:37:21] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker [16:37:21] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker [16:37:21] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker [16:37:21] [main/INFO] [FML]: Forge Mod Loader version 7.10.85.1230 for Minecraft 1.7.10 loading [16:37:21] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_05, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jdk1.8.0_05\jre [16:37:21] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [16:37:21] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker [16:37:21] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin [16:37:21] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [16:37:21] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [16:37:21] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker [16:37:21] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [16:37:21] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [16:37:21] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [16:37:22] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [16:37:27] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [16:37:27] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [16:37:27] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker [16:37:29] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker [16:37:29] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker [16:37:29] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [16:37:32] [main/INFO]: Setting user: Player583 [16:37:39] [Client thread/INFO]: LWJGL Version: 2.9.1 [16:37:43] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [16:37:43] [Client thread/INFO] [FML]: MinecraftForge v10.13.2.1230 Initialized [16:37:43] [Client thread/INFO] [FML]: Replaced 182 ore recipies [16:37:44] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [16:37:45] [Client thread/INFO] [FML]: Searching D:\Jayrol\Minecraft\1710\eclipse\mods for mods [16:38:06] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load [16:38:07] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, examplemod] at CLIENT [16:38:07] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, examplemod] at SERVER [16:38:08] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Example Mod [16:38:08] [Client thread/INFO] [FML]: Processing ObjectHolder annotations [16:38:08] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations [16:38:09] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [16:38:09] [Client thread/INFO] [FML]: Applying holder lookups [16:38:09] [Client thread/INFO] [FML]: Holder lookups applied [16:38:10] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: [16:38:10] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem... [16:38:10] [Thread-6/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL [16:38:10] [Thread-6/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [16:39:39] [Thread-6/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized. [16:39:39] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: [16:39:39] [sound Library Loader/INFO]: Sound engine started [16:39:55] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas [16:39:55] [Client thread/INFO]: Created: 256x256 textures/items-atlas [16:39:56] [Client thread/INFO] [sTDOUT]: [com.example.examplemod.ExampleMod:init:18]: DIRT BLOCK >> tile.dirt [16:39:56] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods [16:39:56] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Example Mod [16:39:56] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas [16:39:57] [Client thread/INFO]: Created: 256x256 textures/items-atlas [16:39:57] [Client thread/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: [16:39:57] [Client thread/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: SoundSystem shutting down... [16:39:57] [Client thread/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]: Author: Paul Lamb, www.paulscode.com [16:39:57] [Client thread/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: [16:39:57] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: [16:39:57] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem... [16:39:57] [Thread-8/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL [16:39:57] [Thread-8/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [16:39:57] [Thread-8/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized. [16:39:58] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: [16:39:58] [sound Library Loader/INFO]: Sound engine started # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000005bb755ec, pid=836, tid=3220 # # JRE version: Java(TM) SE Runtime Environment (8.0_05-b13) (build 1.8.0_05-b13) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode windows-amd64 compressed oops) # Problematic frame: # C [ig4dev64.dll+0x55ec] # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows # # An error report file with more information is saved as: # D:\Jayrol\Minecraft\1710\eclipse\hs_err_pid836.log # # If you would like to submit a bug report, please visit: # http://bugreport.sun.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
  14. well i just done installing forge src for 1.7.10 and i try to run it via eclipse but it crash. do u think its the open gl? or my end of my modding.
  15. Hello everyone im quite newbie in modding but i have a question Can i still update my mod from 1,7,2 to 1.7.10 even if i have opengl2.0 well the reason is everyone is already at 1.7.10 and 1.8 thank you for answering
  16. Hello everyone i was doing a basic packet sending using my own custom mobs using netty tutorial . Now since i have several packets i usually received in console box this code Something like this packet leak "BearsWorld" : 100 im basic in modding thou And as i search i saw diesieben07 tutorial but i was confuse since what i need most methods is not in there. like the handle client side and stuff heres one of my packet bear actually public class PacketAIBearLover extends AbstractPacket { private byte animID; private int entityID; public PacketAIBearLover() { } public PacketAIBearLover(byte anim, EntityBearLover entity) { animID = anim; entityID = entity.getEntityId(); } public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { buffer.writeByte(animID); buffer.writeInt(entityID); } public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { animID = buffer.readByte(); entityID = buffer.readInt(); } public void handleClientSide(EntityPlayer player) { EntityBearLover entity = (EntityBearLover)player.worldObj.getEntityByID(entityID); if(entity != null && animID != -1){ entity.attackID(animID); if(animID == 0) entity.setAttackTick(0); } } public void handleServerSide(EntityPlayer player) { } Please help me how would i start using the IMessageHandler i think or IMessage im really confuse on those
  17. I dont get how come if a player remove an item like this with metadata removes the same as others. I mean i only use a custom item which is useless for my practice and i use only int so they will become unique i have blue ingot , yellow ingot <-- wth wrong?
  18. I got it working , i got some ideas from Heltrato about ints and its awesome what i did is my localized name andtexture are gone to this String[] texture = {"blue","yellow"}; and i use ints to connect
  19. so how do is start with new items with metadata?
  20. My mc.modinfo wont work and heres my notepad. I did exactly put it in the .zip file [ { "modid": DummyAssers"name": "DummyAssers", "description": "Adds a new dimension with some epic new mobs and stuff.", "version": "Alpha 0.2", "mcversion": "1.6.2", "logoFile": "assets/dummyassers/textures/dummy.png", "url": "", "updateUrl": "", "authors": ["aguinmox"], "credits": "Made by the aguinmox", "parent": "", "screenshots": [], "dependencies": [] } ]
  21. I could help but do u use techne ? Im not preferable with techne
  22. Hmmm i have an entity that does that . But i recommend u search for no clip and use the motionY for rendering flying or swimming (Y intercept) and motionX for ghost modes code This really helps a lot =) .
  23. Heres the block portal public class BlockWyverniaPortal extends BlockBreakable { public BlockWyverniaPortal(int par1) { super(par1, "monsterhunter:portal", Material.portal, false); this.setTickRandomly(true); this.setHardness(-1.0F); this.setStepSound(soundGlassFootstep); this.setLightValue(0.75F); } @Override public void registerIcons(IconRegister par1IconRegister) { blockIcon = par1IconRegister.registerIcon("monsterhunter:portal"); } /** * * Ticks the block if it's been scheduled */ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { super.updateTick(par1World, par2, par3, par4, par5Random); if (par1World.provider.isSurfaceWorld() && par5Random.nextInt(2000) < par1World.difficultySetting) { int l; for (l = par3; !par1World.doesBlockHaveSolidTopSurface(par2, l, par4) && l > 0; --l) { ; } if (l > 0 && !par1World.isBlockNormalCube(par2, l + 1, par4)) { Entity entity = ItemMonsterPlacer.spawnCreature(par1World, 57, (double)par2 + 0.5D, (double)l + 1.1D, (double)par4 + 0.5D); if (entity != null) { entity.timeUntilPortal = entity.getPortalCooldown(); } } } } /** * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been * cleared to be reused) */ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; } /** * Updates the blocks bounds based on its current state. Args: world, x, y, z */ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { float f; float f1; if (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) != this.blockID && par1IBlockAccess.getBlockId(par2 + 1, par3, par4) != this.blockID) { f = 0.125F; f1 = 0.5F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); } else { f = 0.5F; f1 = 0.125F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); } } /** * Is this block (a) opaque and (B) a full 1m cube? This determines whether or not to render the shared face of two * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. */ public boolean isOpaqueCube() { return false; } /** * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ @Override public boolean renderAsNormalBlock() { return false; } /** * Checks to see if this location is valid to create a portal and will return True if it does. Args: world, x, y, z */ public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4) { byte b0 = 0; byte b1 = 0; if (par1World.getBlockId(par2 - 1, par3, par4) == MainBlock.blockDesign.blockID || par1World.getBlockId(par2 + 1, par3, par4) == MainBlock.blockDesign.blockID) { b0 = 1; } if (par1World.getBlockId(par2, par3, par4 - 1) == MainBlock.blockDesign.blockID || par1World.getBlockId(par2, par3, par4 + 1) == MainBlock.blockDesign.blockID) { b1 = 1; } if (b0 == b1) { return false; } else { if (par1World.getBlockId(par2 - b0, par3, par4 - b1) == 0) { par2 -= b0; par4 -= b1; } int l; int i1; for (l = -1; l <= 2; ++l) { for (i1 = -1; i1 <= 3; ++i1) { boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3; if (l != -1 && l != 2 || i1 != -1 && i1 != 3) { int j1 = par1World.getBlockId(par2 + b0 * l, par3 + i1, par4 + b1 * l); if (flag) { if (j1 != MainBlock.blockDesign.blockID) { return false; } } else if (j1 != 0 && j1 != MainBlock.portalTrigger.blockID) { return false; } } } } for (l = 0; l < 2; ++l) { for (i1 = 0; i1 < 3; ++i1) { par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, MainBlock.Portal.blockID, 0, 2); } } return true; } } /** * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are * their own) Args: x, y, z, neighbor blockID */ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { byte b0 = 0; byte b1 = 1; if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID) { b0 = 1; b1 = 0; } int i1; for (i1 = par3; par1World.getBlockId(par2, i1 - 1, par4) == this.blockID; --i1) { ; } if (par1World.getBlockId(par2, i1 - 1, par4) != MainBlock.blockDesign.blockID) { par1World.setBlockToAir(par2, par3, par4); } else { int j1; for (j1 = 1; j1 < 4 && par1World.getBlockId(par2, i1 + j1, par4) == this.blockID; ++j1) { ; } if (j1 == 3 && par1World.getBlockId(par2, i1 + j1, par4) == MainBlock.blockDesign.blockID) { boolean flag = par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID; boolean flag1 = par1World.getBlockId(par2, par3, par4 - 1) == this.blockID || par1World.getBlockId(par2, par3, par4 + 1) == this.blockID; if (flag && flag1) { par1World.setBlockToAir(par2, par3, par4); } else { if ((par1World.getBlockId(par2 + b0, par3, par4 + b1) != MainBlock.blockDesign.blockID || par1World.getBlockId(par2 - b0, par3, par4 - b1) != this.blockID) && (par1World.getBlockId(par2 - b0, par3, par4 - b1) != MainBlock.blockDesign.blockID || par1World.getBlockId(par2 + b0, par3, par4 + b1) != this.blockID)) { par1World.setBlockToAir(par2, par3, par4); } } } else { par1World.setBlockToAir(par2, par3, par4); } } } @SideOnly(Side.CLIENT) /** * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given * coordinates. Args: blockAccess, x, y, z, side */ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { if (par1IBlockAccess.getBlockId(par2, par3, par4) == this.blockID) { return false; } else { boolean flag = par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == this.blockID && par1IBlockAccess.getBlockId(par2 - 2, par3, par4) != this.blockID; boolean flag1 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == this.blockID && par1IBlockAccess.getBlockId(par2 + 2, par3, par4) != this.blockID; boolean flag2 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.blockID && par1IBlockAccess.getBlockId(par2, par3, par4 - 2) != this.blockID; boolean flag3 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.blockID && par1IBlockAccess.getBlockId(par2, par3, par4 + 2) != this.blockID; boolean flag4 = flag || flag1; boolean flag5 = flag2 || flag3; return flag4 && par5 == 4 ? true : (flag4 && par5 == 5 ? true : (flag5 && par5 == 2 ? true : flag5 && par5 == 3)); } } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random par1Random) { return 0; } /** * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity */ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { if ((par5Entity.ridingEntity == null) && (par5Entity.riddenByEntity == null) && ((par5Entity instanceof EntityPlayerMP))) { EntityPlayerMP thePlayer = (EntityPlayerMP)par5Entity; if (thePlayer.timeUntilPortal > 0) { thePlayer.timeUntilPortal = 10; } else if (thePlayer.dimension != MonsterHunterFrontier.DimID) { thePlayer.timeUntilPortal = 10; thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, MonsterHunterFrontier.DimID, new TeleporterWyvernia(thePlayer.mcServer.worldServerForDimension(MonsterHunterFrontier.DimID))); } else { thePlayer.timeUntilPortal = 10; thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0, new TeleporterWyvernia(thePlayer.mcServer.worldServerForDimension(0))); } } } @SideOnly(Side.CLIENT) /** * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha */ public int getRenderBlockPass() { return 1; } @SideOnly(Side.CLIENT) /** * A randomly called display update to be able to add particles or other items for display */ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { if (par5Random.nextInt(100) == 0) { par1World.playSound((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "portal.portal", 0.5F, par5Random.nextFloat() * 0.4F + 0.8F, false); } for (int l = 0; l < 4; ++l) { double d0 = (double)((float)par2 + par5Random.nextFloat()); double d1 = (double)((float)par3 + par5Random.nextFloat()); double d2 = (double)((float)par4 + par5Random.nextFloat()); double d3 = 0.0D; double d4 = 0.0D; double d5 = 0.0D; int i1 = par5Random.nextInt(2) * 2 - 1; d3 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; d4 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; d5 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; if (par1World.getBlockId(par2 - 1, par3, par4) != this.blockID && par1World.getBlockId(par2 + 1, par3, par4) != this.blockID) { d0 = (double)par2 + 0.5D + 0.25D * (double)i1; d3 = (double)(par5Random.nextFloat() * 2.0F * (float)i1); } else { d2 = (double)par4 + 0.5D + 0.25D * (double)i1; d5 = (double)(par5Random.nextFloat() * 2.0F * (float)i1); } par1World.spawnParticle("portal", d0, d1, d2, d3, d4, d5); } } @SideOnly(Side.CLIENT) /** * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) */ public int idPicked(World par1World, int par2, int par3, int par4) { return 0; } And about the what i said tick handler lol dont mind that i thought it would make things faster on server =)
×
×
  • Create New...

Important Information

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