Jump to content

[1.8] Creating and rendering a multiblock.....


DuckCreeper

Recommended Posts

So I've been coding more... Now I want to create a multiblox. Basically like immersive egineerings crusher. I want to do something like that, but its the 1.7 version. Most of the code work but... for some reason I cant get my Tile Render working... the one that has the obj file reference thingy....

 

IES Tile render:

package blusunrize.immersiveengineering.client.render;

import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.model.obj.Vertex;

import org.lwjgl.opengl.GL11;

import blusunrize.immersiveengineering.client.ClientUtils;
import blusunrize.immersiveengineering.client.models.ModelIEObj;
import blusunrize.immersiveengineering.common.IEContent;
import blusunrize.immersiveengineering.common.blocks.metal.BlockMetalMultiblocks;
import blusunrize.immersiveengineering.common.blocks.metal.TileEntityCrusher;
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;

public class TileRenderCrusher extends TileRenderIE
{
ModelIEObj model = new ModelIEObj("immersiveengineering:models/crusher.obj")
{
	@Override
	public IIcon getBlockIcon(String groupName)
	{
		return IEContent.blockMetalMultiblocks.getIcon(0, BlockMetalMultiblocks.META_crusher);
	}
};

@Override
public void renderStatic(TileEntity tile, Tessellator tes, Matrix4 translationMatrix, Matrix4 rotationMatrix)
{
	TileEntityCrusher crusher = (TileEntityCrusher)tile;

	translationMatrix.translate(.5, 1.5, .5);
	rotationMatrix.rotate(Math.toRadians(crusher.facing==2?180: crusher.facing==4?-90: crusher.facing==5?90: 0), 0,1,0);
	if(crusher.mirrored)
		translationMatrix.scale(new Vertex(crusher.facing<4?-1:1,1,crusher.facing>3?-1:1));

	model.render(tile, tes, translationMatrix, rotationMatrix, 0, crusher.mirrored, "base");
}
@Override
public void renderDynamic(TileEntity tile, double x, double y, double z, float f)
{
	TileEntityCrusher crusher = (TileEntityCrusher)tile;
	if(!crusher.formed || crusher.pos!=17)
		return;
	GL11.glPushMatrix();

	GL11.glTranslated(x+.5, y+1.5, z+.5);
	GL11.glRotatef(crusher.facing==2?180: crusher.facing==4?-90: crusher.facing==5?90: 0, 0,1,0);

	if(crusher.mirrored)
	{
		GL11.glScalef(-1,1,1);
		GL11.glDisable(GL11.GL_CULL_FACE);
	}

	ClientUtils.bindAtlas(0);
	boolean b = crusher.hasPower&&((crusher.active&&crusher.process>0)||crusher.mobGrinding||crusher.grindingTimer>0);
	float angle = crusher.barrelRotation+(b?18*f:0);

	GL11.glTranslated(17/16f,14/16f,-8.5/16f);
	GL11.glRotatef(angle, 1,0,0);
	model.model.renderOnly("drum1");
	GL11.glRotatef(-angle, 1,0,0);
	GL11.glTranslated(0,0,17/16f);
	GL11.glRotatef(-angle, 1,0,0);
	model.model.renderOnly("drum0");

	if(crusher.mirrored)
	{
		GL11.glScalef(-1,1,1);
		GL11.glEnable(GL11.GL_CULL_FACE);
	}
	GL11.glPopMatrix();
}

}

 

ModelIEObj Code used:

package blusunrize.immersiveengineering.client.models;

import java.util.ArrayList;

import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.model.obj.WavefrontObject;
import blusunrize.immersiveengineering.client.ClientUtils;
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;

public abstract class ModelIEObj
{
public static ArrayList<ModelIEObj> existingStaticRenders = new ArrayList();

public final String path;
public WavefrontObject model;
public ModelIEObj(String path)
{
	this.path = path;
	this.model = ClientUtils.getModel(path);

	existingStaticRenders.add(this);
}

public WavefrontObject rebindModel()
{
	model = ClientUtils.getModel(path);
	return model;
}

public void render(TileEntity tile, Tessellator tes, Matrix4 translationMatrix, Matrix4 rotationMatrix, int offsetLighting, boolean invertFaces, String... renderedParts)
{
	ClientUtils.renderStaticWavefrontModel(tile, model, tes, translationMatrix, rotationMatrix, offsetLighting, invertFaces, renderedParts);
}

public abstract IIcon getBlockIcon(String groupName);
}

 

Here is what I have....

Tile Render:

package com.duckcreeper.steelcraft.entity;


import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;

public class SCTileRender extends TileEntitySpecialRenderer 
{
ModelSCObj model = new ModelSCObj("sc:modles/crushT.obj");

@Override
public void renderTileEntityAt(TileEntity p_180535_1_, double posX,
		double posZ, double p_180535_6_, float p_180535_8_, int p_180535_9_) {
	// TODO Auto-generated method stub

}

}

But when i say

ModelSCObj model = new ModelSCObj()

the ModelSCObj is underlined saying

Cannot instantiate the type ModelSCObj

ModelSCObj:

import java.util.ArrayList;

import com.duckcreeper.steelcraft.Matrix4;

import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity;

public abstract class ModelSCObj
{
public static ArrayList<ModelSCObj> existingStaticRenders = new ArrayList();

public final String path;
public WavefrontObject model;
public ModelSCObj(String path)
{
	this.path = path;
	this.model = ClientUtils.getModel(path);

	existingStaticRenders.add(this);
}

public WavefrontObject rebindModel()
{
	model = ClientUtils.getModel(path);
	return model;
}

public void render(TileEntity tile, Tessellator tes, Matrix4 translationMatrix, Matrix4 rotationMatrix, int offsetLighting, boolean invertFaces, String... renderedParts)
{
	ClientUtils.renderStaticWavefrontModel(tile, model, tes, translationMatrix, rotationMatrix, offsetLighting, invertFaces, renderedParts);
}

public abstract IIcon getBlockIcon(String groupName);
}

 

I get errors on,

	public WavefrontObject model;

--- WavefrontObject cannot be resolved to a type ^^

	this.model = ClientUtils.getModel(path);

--- ClientUtils cannot be resolved amd for "this.model" WavefrontObject cannot be resolved to a type


public WavefrontObject rebindModel() <--- Same thing, WavefrontObject cannot be resolved to a type
{
	model = ClientUtils.getModel(path); <--- Same thing
	return model;
}

	ClientUtils.renderStaticWavefrontModel(tile, model, tes, translationMatrix, rotationMatrix, offsetLighting, invertFaces, renderedParts); 

^^^^ ClientUtils cannot be resolved ^^^^^

public abstract IIcon getBlockIcon(String groupName);

^^^^ IIcon cannot be resolved to a type ^^^^

 

I dont know what to do! I'm a fairly new coder. So any tutorials, or explanations would be nice. :D

Link to comment
Share on other sites

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
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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • 1) Use English on these Forums 2) Remove Optifine, even if you think you need it, you don't. 3) When you remove mods, provide new log files so we can see the issues. 4) Don't spam bump your posts.
    • Unless you helping the original poster of the thread, start your own thread.
    • You need to provide your logs/debug.log so we can see what error (if any) you are getting.   Otherwise, make a copy of your world as a test world. Using that test world experiment with removing mods until the problem goes away. I would start with optifine and any other "optimisation" mods you have. They are always the first candidates for strange bugs. Immersive portals would be another candidate since this seems to be incompatible with a large number of mods.
    • [00:23:17] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgeserver, --fml.forgeVersion, 40.2.1, --fml.mcVersion, 1.18.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220404.173914] [00:23:17] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 9.1.3+9.1.3+main.9b69c82a starting: java version 20 by Oracle Corporation [00:23:17] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/Medo/Desktop/Server.jar/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2314!/ Service=ModLauncher Env=SERVER [00:23:18] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file C:\Users\Medo\Desktop\Server.jar\libraries\net\minecraftforge\fmlcore\1.18.2-40.2.1\fmlcore-1.18.2-40.2.1.jar is missing mods.toml file [00:23:18] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file C:\Users\Medo\Desktop\Server.jar\libraries\net\minecraftforge\javafmllanguage\1.18.2-40.2.1\javafmllanguage-1.18.2-40.2.1.jar is missing mods.toml file [00:23:18] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file C:\Users\Medo\Desktop\Server.jar\libraries\net\minecraftforge\lowcodelanguage\1.18.2-40.2.1\lowcodelanguage-1.18.2-40.2.1.jar is missing mods.toml file [00:23:18] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file C:\Users\Medo\Desktop\Server.jar\libraries\net\minecraftforge\mclanguage\1.18.2-40.2.1\mclanguage-1.18.2-40.2.1.jar is missing mods.toml file [00:23:18] [main/INFO] [ne.mi.fm.lo.mo.JarInJarDependencyLocator/]: Found 3 dependencies adding them to mods collection [00:23:20] [main/INFO] [mixin/]: Compatibility level set to JAVA_17 [00:23:20] [main/INFO] [cp.mo.mo.LaunchServiceHandler/MODLAUNCHER]: Launching target 'forgeserver' with arguments [] [00:23:20] [main/WARN] [mixin/]: Reference map 'naturalist-forge-forge-refmap.json' for naturalist.mixins.json could not be read. If this is a development environment you can ignore this message [00:23:21] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 64) [00:23:21] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 64) [00:23:21] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 64) [00:23:21] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 64) [00:23:21] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 64) [00:23:21] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 64) [00:23:21] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 64) [00:23:21] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 64) [00:23:21] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 64) [00:23:21] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 64) [00:23:22] [main/WARN] [mixin/]: Error loading class: java/lang/Boolean (java.lang.IllegalArgumentException: Unsupported class file major version 64) Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException         at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:39)         at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53)         at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71)         at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.Launcher.run(Launcher.java:106)         at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.Launcher.main(Launcher.java:77)         at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26)         at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23)         at cpw.mods.bootstraplauncher@1.0.0/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149) Caused by: java.lang.reflect.InvocationTargetException         at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)         at java.base/java.lang.reflect.Method.invoke(Method.java:578)         at MC-BOOTSTRAP/fmlloader@1.18.2-40.2.1/net.minecraftforge.fml.loading.targets.CommonServerLaunchHandler.lambda$launchService$0(CommonServerLaunchHandler.java:32)         at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)         ... 7 more Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:392)         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250)         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.service.modlauncher.MixinTransformationHandler.processClass(MixinTransformationHandler.java:131)         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.launch.MixinLaunchPluginLegacy.processClass(MixinLaunchPluginLegacy.java:131)         at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClassWithFlags(ILaunchPluginService.java:156)         at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88)         at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120)         at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50)         at cpw.mods.securejarhandler@1.0.3/cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:110)         at cpw.mods.securejarhandler@1.0.3/cpw.mods.cl.ModuleClassLoader.lambda$findClass$16(ModuleClassLoader.java:216)         at cpw.mods.securejarhandler@1.0.3/cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:226)         at cpw.mods.securejarhandler@1.0.3/cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:216)         at cpw.mods.securejarhandler@1.0.3/cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:132)         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)         at TRANSFORMER/forge@40.2.1/net.minecraftforge.registries.GameData.init(GameData.java:123)         at TRANSFORMER/forge@40.2.1/net.minecraftforge.registries.GameData.<clinit>(GameData.java:108)         at TRANSFORMER/minecraft@1.18.2/net.minecraft.core.Registry.forge(Registry.java:407)         at TRANSFORMER/minecraft@1.18.2/net.minecraft.core.Registry.forge(Registry.java:391)         at TRANSFORMER/minecraft@1.18.2/net.minecraft.core.Registry.<clinit>(Registry.java:170)         at TRANSFORMER/minecraft@1.18.2/net.minecraft.server.Bootstrap.m_135870_(Bootstrap.java:44)         at TRANSFORMER/minecraft@1.18.2/net.minecraft.server.Main.main(Main.java:109)         at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)         ... 10 more Caused by: org.spongepowered.asm.mixin.throwables.ClassMetadataNotFoundException: java.lang.Boolean         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.transformMethod(MixinPreProcessorStandard.java:754)         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.transform(MixinPreProcessorStandard.java:739)         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attach(MixinPreProcessorStandard.java:310)         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.createContextFor(MixinPreProcessorStandard.java:280)         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinInfo.createContextFor(MixinInfo.java:1288)         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:292)         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:383)         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:365)         at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363)         ... 31 more
  • Topics

×
×
  • Create New...

Important Information

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