Spaceboy Ross
Members-
Posts
143 -
Joined
-
Last visited
Everything posted by Spaceboy Ross
-
[1.12] Player control riding custom entity
Spaceboy Ross replied to Spaceboy Ross's topic in Modder Support
Check the GundamItems class. -
JAR creation failed. See details for additional information. Resource is out of sync with the file system: '/MS Gundam Mod/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml'. Resource is out of sync with the file system: '/MS Gundam Mod/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml'.
-
[1.12] Player control riding custom entity
Spaceboy Ross replied to Spaceboy Ross's topic in Modder Support
It's easier that way for my code. -
What's your item class code?
-
[1.12] Player control riding custom entity
Spaceboy Ross replied to Spaceboy Ross's topic in Modder Support
I've attached the entity code. How do I make my code work so that the player can control it. public float scale = 1.0f; private EntityPlayer pilot; public int armamentLeftHand = -1; public int armamentRightHand = -1; private boolean leftInputDown = false; private boolean rightInputDown = false; private boolean forwardInputDown = false; private boolean backInputDown = false; public MSMob(World worldIn) { super(worldIn); this.heal(Float.MAX_VALUE); } @SideOnly(Side.CLIENT) public void updateInputs(boolean p_184442_1_,boolean p_184442_2_,boolean p_184442_3_,boolean p_184442_4_) { this.leftInputDown = p_184442_1_; this.rightInputDown = p_184442_2_; this.forwardInputDown = p_184442_3_; this.backInputDown = p_184442_4_; System.out.println(this.backInputDown); } private void control() { if(this.isBeingRidden()) { float f = 0.0F; if(this.rightInputDown != this.leftInputDown && !this.forwardInputDown && !this.backInputDown) f += 0.005F; if(this.forwardInputDown) f += 0.04F; if(this.backInputDown) f -= 0.005F; this.motionX += (double)f; this.motionZ += (double)f; } } @Override public boolean canPassengerSteer() { return true; } @Override public boolean canBreatheUnderwater() { return true; } @Override public NBTTagCompound writeToNBT(NBTTagCompound root) { root = super.writeToNBT(root); NBTTagCompound ms = new NBTTagCompound(); ms.setInteger("armamentLeftHand",this.armamentLeftHand); ms.setInteger("armamentRightHand",this.armamentRightHand); NBTTagList armaments = new NBTTagList(); for(int i = 0;i < this.getMSRegistryEntry().getArmamentCount();i++) { MobileSuitArmament armament = this.getMSRegistryEntry().getArmament(i); armaments.appendTag(armament.saveNBT()); } ms.setTag("armaments",armaments); root.setTag("mobileSuit",ms); return root; } @Override public void readFromNBT(NBTTagCompound root) { super.readFromNBT(root); if(root.hasKey("mobileSuit")) { NBTTagCompound ms = root.getCompoundTag("mobileSuit"); this.armamentLeftHand = ms.getInteger("armamentLeftHand"); this.armamentRightHand = ms.getInteger("armamentRightHand"); if(ms.hasKey("armaments")) { NBTTagList armaments = ms.getTagList("armaments",10); for(int i = 0;i < armaments.tagCount();i++) { MobileSuitArmament armament = this.getMSRegistryEntry().getArmament(i); armament.loadNBT(armaments.getCompoundTagAt(i)); } } } } @Override public boolean processInteract(EntityPlayer player,EnumHand hand) { if(player.inventory.getStackInSlot(player.inventory.currentItem).getItem().getUnlocalizedName().equals("item."+GundamMod.MODID+".wrench")) { // TODO: show customization interface } else { if(this.pilot != null) return false; this.pilot = player; this.pilot.startRiding(this); IHumanCapability human = Human.getHuman(this.pilot); human.setMS(this); if(this.pilot.world.isRemote) Minecraft.getMinecraft().setRenderViewEntity(this); } return true; } @Override public void onUpdate() { super.onUpdate(); this.control(); this.move(MoverType.SELF,this.motionX,this.motionY,this.motionZ); } public EntityPlayer getPilot() { return this.pilot; } public MobileSuit getMSRegistryEntry() { return MSRegistry.getMobileSuit(this.getName()); } @Override public boolean canRiderInteract() { return true; } @Override public boolean canBeSteered() { return true; } private void updateRiderPosition(Entity entity) { if(entity != null) { entity.setPosition(this.posX,this.posY+(getMountedYOffset()+entity.getYOffset())/2,this.posZ); } } @Override public void updatePassenger(Entity passenger) { this.updateRiderPosition(passenger); passenger.setInvisible(true); this.rotationPitch = passenger.rotationPitch; this.rotationYaw = passenger.rotationYaw; this.motionX = passenger.motionX; this.motionY = passenger.motionY; this.motionZ = passenger.motionZ; } @Override public void removePassenger(Entity passenger) { if(passenger != null) passenger.setPosition(this.posX,this.posY,this.posZ); super.removePassenger(passenger); passenger.setInvisible(false); if(passenger instanceof EntityPlayer) { IHumanCapability human = Human.getHuman((EntityPlayer)passenger); human.setMS(null); this.pilot = null; human.syncToServer(); Minecraft.getMinecraft().setRenderViewEntity(passenger); } } -
I'm trying to get it so that the movement keys control the movement of my custom entity, I already looked at the boat and pig code but I couldn't get it to work.
-
[1.12] Render what entity sees on screen
Spaceboy Ross replied to Spaceboy Ross's topic in Modder Support
I've got it working now, I just need to figure out how to get the movement working. -
[1.12] Render what entity sees on screen
Spaceboy Ross replied to Spaceboy Ross's topic in Modder Support
I only need to be able to control the entity and see what the entity sees on the screen. -
[1.12] Render what entity sees on screen
Spaceboy Ross replied to Spaceboy Ross's topic in Modder Support
Can I please have a snippet of the code I need? I can't figure out how to get it to work. -
I'm trying to add custom music discs into my mod for Minecraft 1.12, I've searched Google and I couldn't find anything useful.
-
That's about 2GB, so maybe it'll work.
-
It's a custom model with the OBJLoader. And I don't know how to upload every vertex to the BufferBuilder, could you please show an example?
-
This is what I'm doing now, I like having it this way. And in combination with this other one, I can make a cool looking cockpit.
-
I'm trying to get what the entity the player is riding sees and render it on screen.
-
So, from what I can tell is your hardware isn't good enough to run it. I looked through old forum posts and that's what I concluded based on what other people have said before.
-
I'm trying to render a .obj model onto the screen, I've already gotten it to load. How do I do the rendering portion?
-
I'm not going to override the player rendering, going to try something else.
-
-
It already has a player design, the skin works when it's rendering the entity instead of overriding the player model.
-
Are you sure you didn't tell it to give you two?
-
Try rebuilding with gradle.
-
[1.12.2] Getting all files in custom assets folder
Spaceboy Ross replied to Tschipp's topic in Modder Support
Well, then you cant do what you're trying to do. -
[1.12.2] Getting all files in custom assets folder
Spaceboy Ross replied to Tschipp's topic in Modder Support
It should look something like this. Minecraft.getMinecraft().getResourceManager().getAllResources(new ResourceLocation(MODID,"dir.subdir")); You cannot access it like a path, you have to access it like a package. -
onDroppedByPlayer is the function that you're actually looking for.
-
I believe that there's an onTileDrop function.