Jump to content

Recommended Posts

Posted

Since there doesn't seem to be any software for changing Java model classes to JSON, is there a good does anyone know of a good tutorial on how to write JSON block models? Specifically, I'm needing to translate this:

 

package com.gw.dm.model;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;

public class ModelBladeTrap extends ModelBase {

	ModelRenderer Base;
	ModelRenderer BotSpikeB;
	ModelRenderer BotSpikeC;
	ModelRenderer BotSpikeD;
	ModelRenderer BotSpikeA;
	ModelRenderer TopSpikeA;
	ModelRenderer TopSpikeC;
	ModelRenderer TopSpikeD;
	ModelRenderer TopSpikeB;
	ModelRenderer RerSpikeB;
	ModelRenderer RerSpikeC;
	ModelRenderer RerSpikeD;
	ModelRenderer RerSpikeA;
	ModelRenderer FrnSpikeA;
	ModelRenderer FrnSpikeC;
	ModelRenderer FrnSpikeD;
	ModelRenderer FrnSpikeB;
	ModelRenderer LftSpikeB;
	ModelRenderer LftSpikeC;
	ModelRenderer LftSpikeD;
	ModelRenderer LftSpikeA;
	ModelRenderer RitSpikeD;
	ModelRenderer RitSpikeC;
	ModelRenderer RitSpikeA;
	ModelRenderer RitSpikeB;


	public ModelBladeTrap() {
		textureWidth = 64;
		textureHeight = 32;

		Base = new ModelRenderer(this, 0, 0);
		Base.addBox(-2.5F, -2.5F, -2.5F, 5, 5, 5);
		Base.setRotationPoint(0F, 16.5F, 0F);
		Base.setTextureSize(64, 32);
		Base.mirror = true;
		setRotation(Base, 0F, 0F, 0F);

		BotSpikeB = new ModelRenderer(this, 2, 12);
		BotSpikeB.addBox(-0.5F, 0F, -0.5F, 1, 4, 1);
		BotSpikeB.setRotationPoint(1.5F, 19F, -1.5F);
		BotSpikeB.setTextureSize(64, 32);
		BotSpikeB.mirror = true;
		setRotation(BotSpikeB, 0F, 0F, 0F);

		BotSpikeC = new ModelRenderer(this, 2, 12);
		BotSpikeC.addBox(-0.5F, 0F, -0.5F, 1, 4, 1);
		BotSpikeC.setRotationPoint(-1.5F, 19F, 1.5F);
		BotSpikeC.setTextureSize(64, 32);
		BotSpikeC.mirror = true;
		setRotation(BotSpikeC, 0F, 0F, 0F);

		BotSpikeD = new ModelRenderer(this, 2, 12);
		BotSpikeD.addBox(-0.5F, 0F, -0.5F, 1, 4, 1);
		BotSpikeD.setRotationPoint(-1.5F, 19F, -1.5F);
		BotSpikeD.setTextureSize(64, 32);
		BotSpikeD.mirror = true;
		setRotation(BotSpikeD, 0F, 0F, 0F);

		BotSpikeA = new ModelRenderer(this, 2, 12);
		BotSpikeA.addBox(-0.5F, 0F, -0.5F, 1, 4, 1);
		BotSpikeA.setRotationPoint(1.5F, 19F, 1.5F);
		BotSpikeA.setTextureSize(64, 32);
		BotSpikeA.mirror = true;
		setRotation(BotSpikeA, 0F, 0F, 0F);

		TopSpikeA = new ModelRenderer(this, 0, 11);
		TopSpikeA.addBox(-0.5F, -4F, -0.5F, 1, 4, 1);
		TopSpikeA.setRotationPoint(1.5F, 14F, 1.5F);
		TopSpikeA.setTextureSize(64, 32);
		TopSpikeA.mirror = true;
		setRotation(TopSpikeA, 0F, 0F, 0F);

		TopSpikeC = new ModelRenderer(this, 0, 11);
		TopSpikeC.addBox(-0.5F, -4F, -0.5F, 1, 4, 1);
		TopSpikeC.setRotationPoint(-1.5F, 14F, 1.5F);
		TopSpikeC.setTextureSize(64, 32);
		TopSpikeC.mirror = true;
		setRotation(TopSpikeC, 0F, 0F, 0F);

		TopSpikeD = new ModelRenderer(this, 0, 11);
		TopSpikeD.addBox(-0.5F, -4F, -0.5F, 1, 4, 1);
		TopSpikeD.setRotationPoint(-1.5F, 14F, -1.5F);
		TopSpikeD.setTextureSize(64, 32);
		TopSpikeD.mirror = true;
		setRotation(TopSpikeD, 0F, 0F, 0F);

		TopSpikeB = new ModelRenderer(this, 0, 11);
		TopSpikeB.addBox(-0.5F, -4F, -0.5F, 1, 4, 1);
		TopSpikeB.setRotationPoint(1.5F, 14F, -1.5F);
		TopSpikeB.setTextureSize(64, 32);
		TopSpikeB.mirror = true;
		setRotation(TopSpikeB, 0F, 0F, 0F);

		RerSpikeB = new ModelRenderer(this, 2, 12);
		RerSpikeB.addBox(-4F, -0.5F, -0.5F, 4, 1, 1);
		RerSpikeB.setRotationPoint(-2F, 18F, 1.5F);
		RerSpikeB.setTextureSize(64, 32);
		RerSpikeB.mirror = true;
		setRotation(RerSpikeB, 0F, 0F, 0F);

		RerSpikeC = new ModelRenderer(this, 2, 12);
		RerSpikeC.addBox(-4F, -0.5F, -0.5F, 4, 1, 1);
		RerSpikeC.setRotationPoint(-2F, 15F, -1.5F);
		RerSpikeC.setTextureSize(64, 32);
		RerSpikeC.mirror = true;
		setRotation(RerSpikeC, 0F, 0F, 0F);

		RerSpikeD = new ModelRenderer(this, 2, 12);
		RerSpikeD.addBox(-4F, -0.5F, -0.5F, 4, 1, 1);
		RerSpikeD.setRotationPoint(-2F, 18F, -1.5F);
		RerSpikeD.setTextureSize(64, 32);
		RerSpikeD.mirror = true;
		setRotation(RerSpikeD, 0F, 0F, 0F);

		RerSpikeA = new ModelRenderer(this, 2, 12);
		RerSpikeA.addBox(-4F, -0.5F, -0.5F, 4, 1, 1);
		RerSpikeA.setRotationPoint(-2F, 15F, 1.5F);
		RerSpikeA.setTextureSize(64, 32);
		RerSpikeA.mirror = true;
		setRotation(RerSpikeA, 0F, 0F, 0F);

		FrnSpikeA = new ModelRenderer(this, 2, 12);
		FrnSpikeA.addBox(0F, -0.5F, -0.5F, 4, 1, 1);
		FrnSpikeA.setRotationPoint(2F, 15F, 1.5F);
		FrnSpikeA.setTextureSize(64, 32);
		FrnSpikeA.mirror = true;
		setRotation(FrnSpikeA, 0F, 0F, 0F);

		FrnSpikeC = new ModelRenderer(this, 2, 12);
		FrnSpikeC.addBox(0F, -0.5F, -0.5F, 4, 1, 1);
		FrnSpikeC.setRotationPoint(2F, 15F, -1.5F);
		FrnSpikeC.setTextureSize(64, 32);
		FrnSpikeC.mirror = true;
		setRotation(FrnSpikeC, 0F, 0F, 0F);

		FrnSpikeD = new ModelRenderer(this, 2, 12);
		FrnSpikeD.addBox(0F, -0.5F, -0.5F, 4, 1, 1);
		FrnSpikeD.setRotationPoint(2F, 18F, -1.5F);
		FrnSpikeD.setTextureSize(64, 32);
		FrnSpikeD.mirror = true;
		setRotation(FrnSpikeD, 0F, 0F, 0F);

		FrnSpikeB = new ModelRenderer(this, 2, 12);
		FrnSpikeB.addBox(0F, -0.5F, -0.5F, 4, 1, 1);
		FrnSpikeB.setRotationPoint(2F, 18F, 1.5F);
		FrnSpikeB.setTextureSize(64, 32);
		FrnSpikeB.mirror = true;
		setRotation(FrnSpikeB, 0F, 0F, 0F);

		LftSpikeB = new ModelRenderer(this, 2, 12);
		LftSpikeB.addBox(-0.5F, -0.5F, -4F, 1, 1, 4);
		LftSpikeB.setRotationPoint(1.5F, 15F, -2F);
		LftSpikeB.setTextureSize(64, 32);
		LftSpikeB.mirror = true;
		setRotation(LftSpikeB, 0F, 0F, 0F);

		LftSpikeC = new ModelRenderer(this, 2, 12);
		LftSpikeC.addBox(-0.5F, -0.5F, -4F, 1, 1, 4);
		LftSpikeC.setRotationPoint(-1.5F, 18F, -2F);
		LftSpikeC.setTextureSize(64, 32);
		LftSpikeC.mirror = true;
		setRotation(LftSpikeC, 0F, 0F, 0F);

		LftSpikeD = new ModelRenderer(this, 2, 12);
		LftSpikeD.addBox(-0.5F, -0.5F, -4F, 1, 1, 4);
		LftSpikeD.setRotationPoint(1.5F, 18F, -2F);
		LftSpikeD.setTextureSize(64, 32);
		LftSpikeD.mirror = true;
		setRotation(LftSpikeD, 0F, 0F, 0F);

		LftSpikeA = new ModelRenderer(this, 2, 12);
		LftSpikeA.addBox(-0.5F, -0.5F, -4F, 1, 1, 4);
		LftSpikeA.setRotationPoint(-1.5F, 15F, -2F);
		LftSpikeA.setTextureSize(64, 32);
		LftSpikeA.mirror = true;
		setRotation(LftSpikeA, 0F, 0F, 0F);

		RitSpikeD = new ModelRenderer(this, 2, 12);
		RitSpikeD.addBox(-0.5F, -0.5F, 0F, 1, 1, 4);
		RitSpikeD.setRotationPoint(1.5F, 18F, 2F);
		RitSpikeD.setTextureSize(64, 32);
		RitSpikeD.mirror = true;
		setRotation(RitSpikeD, 0F, 0F, 0F);

		RitSpikeC = new ModelRenderer(this, 2, 12);
		RitSpikeC.addBox(-0.5F, -0.5F, 0F, 1, 1, 4);
		RitSpikeC.setRotationPoint(-1.5F, 18F, 2F);
		RitSpikeC.setTextureSize(64, 32);
		RitSpikeC.mirror = true;
		setRotation(RitSpikeC, 0F, 0F, 0F);

		RitSpikeA = new ModelRenderer(this, 2, 12);
		RitSpikeA.addBox(-0.5F, -0.5F, 0F, 1, 1, 4);
		RitSpikeA.setRotationPoint(-1.5F, 15F, 2F);
		RitSpikeA.setTextureSize(64, 32);
		RitSpikeA.mirror = true;
		setRotation(RitSpikeA, 0F, 0F, 0F);

		RitSpikeB = new ModelRenderer(this, 2, 12);
		RitSpikeB.addBox(-0.5F, -0.5F, 0F, 1, 1, 4);
		RitSpikeB.setRotationPoint(1.5F, 15F, 2F);
		RitSpikeB.setTextureSize(64, 32);
		RitSpikeB.mirror = true;
		setRotation(RitSpikeB, 0F, 0F, 0F);
	}


	@Override	
	public void render(Entity entity, float limbSwing, float limbSwingAmount,
	                   float ageInTicks, float netHeadYaw, float headPitch, float scale) {
		super.render(entity, limbSwing, limbSwingAmount, ageInTicks, 
				netHeadYaw, headPitch, scale);
		setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, 
				netHeadYaw, headPitch, scale, entity);
		Base.render(scale);
		BotSpikeB.render(scale);
		BotSpikeC.render(scale);
		BotSpikeD.render(scale);
		BotSpikeA.render(scale);
		TopSpikeA.render(scale);
		TopSpikeC.render(scale);
		TopSpikeD.render(scale);
		TopSpikeB.render(scale);
		RerSpikeB.render(scale);
		RerSpikeC.render(scale);
		RerSpikeD.render(scale);
		RerSpikeA.render(scale);
		FrnSpikeA.render(scale);
		FrnSpikeC.render(scale);
		FrnSpikeD.render(scale);
		FrnSpikeB.render(scale);
		LftSpikeB.render(scale);
		LftSpikeC.render(scale);
		LftSpikeD.render(scale);
		LftSpikeA.render(scale);
		RitSpikeD.render(scale);
		RitSpikeC.render(scale);
		RitSpikeA.render(scale);
		RitSpikeB.render(scale);
	}


	private void setRotation(ModelRenderer model, float x, float y, float z) {
		model.rotateAngleX = x;
		model.rotateAngleY = y;
		model.rotateAngleZ = z;
	}


	@Override
	public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) {
		super.setRotationAngles(f, f1, f2, f3, f4, f5, ent);
	}
	
	
	public void renderAllTE(float scale) {
		Base.render(scale);
		BotSpikeB.render(scale);
		BotSpikeC.render(scale);
		BotSpikeD.render(scale);
		BotSpikeA.render(scale);
		TopSpikeA.render(scale);
		TopSpikeC.render(scale);
		TopSpikeD.render(scale);
		TopSpikeB.render(scale);
		RerSpikeB.render(scale);
		RerSpikeC.render(scale);
		RerSpikeD.render(scale);
		RerSpikeA.render(scale);
		FrnSpikeA.render(scale);
		FrnSpikeC.render(scale);
		FrnSpikeD.render(scale);
		FrnSpikeB.render(scale);
		LftSpikeB.render(scale);
		LftSpikeC.render(scale);
		LftSpikeD.render(scale);
		LftSpikeA.render(scale);
		RitSpikeD.render(scale);
		RitSpikeC.render(scale);
		RitSpikeA.render(scale);
		RitSpikeB.render(scale);
	}

}

 

Into something that can render as a block.  I've tried using a TESR to render it through its tile entity, but haven't gotten anywhere with that -- also, its not really animated, so a basic block model is probably more appropriate.  The catch is, the block needs to look just like the entity it spawns ("turns into" for the player), so maybe if I could just create a JSON file based on the same numbers that would be best.  Only problem is I don't really know how, and otherwise I'll have to wait for someone else to (maybe) create a model of fix the TESR code.  Any ideas where to start for learning this?  (Or is this a silly idea?)

 

Thanks!

Developer of Doomlike Dungeons.

Posted

Posting a picture of what it looks like would probably be more helpful.

In any case, I suggest using a tool like Blockbench or MrCrayfish. There are a few others as well.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Well, the new version (1.12.2, and also 1.7.10) looks like this as a mob:

2018-07-15_19.08.10.png

 

But maybe I'm being too picky -- the in the classic 1.6.4 version the mob and block didn't actually look alike at all (though I'd still find it preferable):

2018-07-15_19.06.24.png

 

BTW, I didn't think any of those tool could convert Java class, and didn't really think they liked raw numeric input.  I've looked at and down loaded Mr. Crayfishes a while back, but never really used except once as a test.

 

Thanks.

Developer of Doomlike Dungeons.

Posted
15 minutes ago, JaredBGreat said:

I didn't think any of those tool could convert Java class

They can't, but that mob looks pretty easy to rebuild as a model in one of them.

Looks like the model could be done in *counts* 13 cuboids. Once for the central body and then 4 for each of the 3 axises (they'd be long, so rather than 24 spikes, you'd make 12 rods).

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

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