Everything posted by Animefan8888
-
[1.10] Changing village blocks
Make it in code aka .java syntax.
-
[1.10.2][SOLVED] Saving player data
Listen to eclipse it is probably an invalid arguement.
-
[1.10.2] Event not working at all.
Ohh, you mean print to console? I just tested it now, apparently the init method on my CommonProxy doesn't load at all. How can I fix this? Obviously you need to call it from your main init method in your main mod class.
-
[1.10.02] Blockstate Problem
Show where you registered the block, and was there an error in the log?
-
1.10.2 How do i make Villagers use the Biped Human model?
Look for where the model is "binded" to the entity Where? Either in the Entity or in the Renderer.
-
[1.10.2] Event not working at all.
Are there multiple MouseEvents? I will post all of the code that was changed from jabelar's tutorial to fit 1.10 in a bit. I'm not on the same computer that has it right now. MouseEvent should be donenin client proxy because the server doesnt need to know what do you have inside that method? Are you importing the correct MouseEvent? net.minecraftforge.client.event.MouseEvent is being imported. I moved it from CommonProxy to ClientProxy, still no difference. MouseEventHandler: package bloopers.spearmod.reach; import java.awt.List; import org.lwjgl.input.Mouse; import bloopers.spearmod.SpearMod; 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.math.AxisAlignedBB; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.Vec3d; import net.minecraftforge.client.event.MouseEvent; import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class MouseEventHandler { @SideOnly(Side.CLIENT) @SubscribeEvent @EventHandler public void onEvent(MouseEvent event) { int button = event.getButton(); boolean buttonstate = event.isButtonstate(); if (button == 0 && buttonstate) { Minecraft mc = Minecraft.getMinecraft(); EntityPlayer thePlayer = mc.thePlayer; if (thePlayer != null) { ItemStack itemstack = thePlayer.getHeldItemMainhand(); IExtendedReach ieri; if (itemstack != null) { if (itemstack.getItem() instanceof IExtendedReach) { ieri = (IExtendedReach) itemstack.getItem(); } else { ieri = null; } if (ieri != null) { float reach = ieri.getReach(); RayTraceResult mov = getMouseOverExtended(reach); if (mov != null) { if (mov.entityHit != null && mov.entityHit.hurtResistantTime == 0) { if (mov.entityHit != thePlayer ) { SpearMod.network.sendToServer(new MessageExtendedReachAttack( mov.entityHit.getEntityId())); } } } } } } } } // This is mostly copied from the EntityRenderer#getMouseOver() method public static RayTraceResult getMouseOverExtended(float dist) { Minecraft mc = FMLClientHandler.instance().getClient(); Entity theRenderViewEntity = mc.getRenderViewEntity(); AxisAlignedBB theViewBoundingBox = new AxisAlignedBB( theRenderViewEntity.posX-0.5D, theRenderViewEntity.posY-0.0D, theRenderViewEntity.posZ-0.5D, theRenderViewEntity.posX+0.5D, theRenderViewEntity.posY+1.5D, theRenderViewEntity.posZ+0.5D ); RayTraceResult returnMOP = null; if (mc.theWorld != null) { double var2 = dist; returnMOP = theRenderViewEntity.rayTrace(var2, 0); double calcdist = var2; Vec3d pos = theRenderViewEntity.getPositionEyes(0); var2 = calcdist; if (returnMOP != null) { calcdist = returnMOP.hitVec.distanceTo(pos); } Vec3d lookvec = theRenderViewEntity.getLook(0); Vec3d var8 = pos.addVector(lookvec.xCoord * var2, lookvec.yCoord * var2, lookvec.zCoord * var2); Entity pointedEntity = null; float var9 = 1.0F; @SuppressWarnings("unchecked") java.util.List<Entity> list = mc.theWorld.getEntitiesWithinAABBExcludingEntity( theRenderViewEntity, theViewBoundingBox.addCoord( lookvec.xCoord * var2, lookvec.yCoord * var2, lookvec.zCoord * var2).expand(var9, var9, var9)); double d = calcdist; for (Entity entity : list) { if (entity.canBeCollidedWith()) { float bordersize = entity.getCollisionBorderSize(); AxisAlignedBB aabb = new AxisAlignedBB( entity.posX-entity.width/2, entity.posY, entity.posZ-entity.width/2, entity.posX+entity.width/2, entity.posY+entity.height, entity.posZ+entity.width/2); aabb.expand(bordersize, bordersize, bordersize); RayTraceResult mop0 = aabb.calculateIntercept(pos, var8); if (aabb.isVecInside(pos)) { if (0.0D < d || d == 0.0D) { pointedEntity = entity; d = 0.0D; } } else if (mop0 != null) { double d1 = pos.distanceTo(mop0.hitVec); if (d1 < d || d == 0.0D) { pointedEntity = entity; d = d1; } } } } if (pointedEntity != null && (d < calcdist || returnMOP == null)) { returnMOP = new RayTraceResult(pointedEntity); } } return returnMOP; } } MessageExtendedReachAttack: package bloopers.spearmod.reach; import bloopers.spearmod.SpearMod; import io.netty.buffer.ByteBuf; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; public class MessageExtendedReachAttack implements IMessage { private int entityId ; public MessageExtendedReachAttack() { // need this constructor } public MessageExtendedReachAttack(int parEntityId) { entityId = parEntityId; // DEBUG System.out.println("Constructor"); } @Override public void fromBytes(ByteBuf buf) { entityId = ByteBufUtils.readVarInt(buf, 4); // DEBUG System.out.println("fromBytes"); } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeVarInt(buf, entityId, 4); // DEBUG System.out.println("toBytes encoded"); } public static class Handler implements IMessageHandler<MessageExtendedReachAttack, IMessage> { @Override public IMessage onMessage(final MessageExtendedReachAttack message, MessageContext ctx) { // DEBUG System.out.println("Message received"); // Know it will be on the server so make it thread-safe final EntityPlayerMP thePlayer = (EntityPlayerMP) SpearMod.proxy. getPlayerEntityFromContext(ctx); thePlayer.getServer().addScheduledTask( new Runnable() { @Override public void run() { Entity theEntity = thePlayer.worldObj. getEntityByID(message.entityId); // DEBUG System.out.println("Entity = "+theEntity); // Need to ensure that hackers can't cause trick kills, // so double check weapon type and reach if (thePlayer.getHeldItemMainhand() == null) { return; } if (thePlayer.getHeldItemMainhand().getItem() instanceof IExtendedReach) { IExtendedReach theExtendedReachWeapon = (IExtendedReach)thePlayer.getHeldItemMainhand(). getItem(); double distanceSq = thePlayer.getDistanceSqToEntity( theEntity); double reachSq =theExtendedReachWeapon.getReach()* theExtendedReachWeapon.getReach(); if (reachSq >= distanceSq) { thePlayer.attackTargetEntityWithCurrentItem( theEntity); } } return; // no response in this case } } ); return null; // no response message } } } IExtendedReach: package bloopers.spearmod.reach; public interface IExtendedReach { public float getReach(); // default is 1.0D } And then in item classes to set the reach: @Override public float getReach() { return 15.0F; } At 15 for testing. What is button 0?
-
1.10.2 How do i make Villagers use the Biped Human model?
Look for where the model is "binded" to the entity
-
[1.10.2] Event not working at all.
Are there multiple MouseEvents? I will post all of the code that was changed from jabelar's tutorial to fit 1.10 in a bit. I'm not on the same computer that has it right now. MouseEvent should be donenin client proxy because the server doesnt need to know what do you have inside that method? Are you importing the correct MouseEvent?
-
[1.10.2] Event not working at all.
Yes. And inside it is everything the event should do. Do you know Java or was that a retorical question?
-
[1.10] Changing village blocks
Put in a pull request on forges github, i do not know if they will accept it or not.
-
[1.10.2] Texture clipping
To be more specific createTileEntity(IBlockAccess world, IBlockState state) hasTileEntitity(IBlockState state) I noticed you have getBlockLayer(...) set to translucent, what are the other options there as i do not remember (no IDE or code ATM).
-
Crash on world load 1.10
Is INSTANCE ever initialized?
-
Crash on world load 1.10
Is this your class? com/schematica/client/renderer/RenderSchematic
-
1.10.2 How to do armor
Check when you initialize your helmet you are not even using your armor class. Also you didnt post the whole error log. Dont use the deprecated registerItem method. And why are you using getUnlocalizedName that is why you have a registryName GameRegistry.register(item); Not GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5);
-
1.10.2 How to do armor
Well is it not working? If so probably, but this is what i meant // Not this public static ItemAWArmor iridium_helmate; // This public static Item IRIDIUM_HELMET; // And yes that is how it is spelt.
-
1.10.2 How to do armor
The field ahould be of the type Item yes, but your class should extend ItemArmor.
-
Making a Multi-Tool
Obviously take the functions not the methods exactly from those tools.
-
1.10 crashes on start + missing sounds.
Item Items SoundEvent... plural
-
1.10 crashes on start + missing sounds.
It is because you are creating a new SoundEvent like items they are singletons.
-
1.10 crashes on start + missing sounds.
Why are you passing null for the first parameter?
-
Help with recipe class [1.7.10]
1.7 is no longer supported here as soon as a moderator sees this thread it will be locked and you will be asked to update.
-
[1.10.2] Block renders on world but not in hand
I tried that earlier today and didn't helped either... Unless I did it wrong. Like this? block_aim_furnace.json (on assets/aim/blockstates) { "variants": { "facing=north": { "model": "aim:block_aim_furnace" }, "facing=south": { "model": "aim:block_aim_furnace", "y": 180 }, "facing=west": { "model": "aim:block_aim_furnace", "y": 270 }, "facing=east": { "model": "aim:block_aim_furnace", "y": 90 }, "inventory": { "model": "aim:block_aim_furnace" } } } Try a posting the log.
-
[1.10.2] Detect creative mode during AnvilUpdateEvent
What is the behavior as im pretty sure that ContainerRepair/SlotRepair (i think that is a thing) handles the subtracting, though i do agree that the player should be passed. About the pull request i think you just need to specify what you are changing and provide the code.
-
Overriding all projectile motion to match server changes
If I have read through the code correctly then increasing updateFrequency should increase the time (please correct me if I am wrong provide location in code please). Considering it uses % to check aka updateCounter % updateFrequency == 0 send packet. This will make it smoother, but that is De-syncing the entity as the entity is not receiving many position updates. But this should be ignored if it is airborne or it is dirty(needing to be saved). The 128(trackingRange) is definitely good because if you look at Minecraft entities they go up to 256(EntityEnderCrystal). While some do go over 20 that includes EntityHanging, EntityAreaEffectCloud, and EntityEnderCrystal they all use the value of Integer.MAX_VALUE (aka. 2,147,483,647). This is probably because hanging entities do not need position updates, (not quite sure what EntityAreaEffectCloud is), and EntityEnderCrystal also only needs one sync. They only need one because they do not move at least not normally.
-
[1.10.2] Detect creative mode during AnvilUpdateEvent
I feel as if my answer was kinda pushed to the side.... Maybe I should ask my question Why do you need the player? Are you trying to grab player information(capability data) or just to check creative mode? Or are you just going to check if Player is not creative then change the data. Because as I said vanilla behavior most likely means grab recipe for anvil.
IPS spam blocked by CleanTalk.