sjoopies
-
Posts
32 -
Joined
-
Last visited
Posts posted by sjoopies
-
-
My entities are not instances of EntityLivingBase.
-
This is my code that only works for client side:
https://gist.github.com/anonymous/81e2a90998f318f1c47d
-
Does it matter, because it's kind of complicated?
-
I want to use Minecraft.getMinecraft().objectMouseOver to get the entity I'm looking at, but it does not work for server side. Is there any server side way I can do this?
-
I fixed it... I had two build.gradles open and i put the "repositories" thing in the wrong file.
-
-
If you mean in the build.gradle then yes
-
I added the dependency for the JEI and I got this error when trying to setupDecompWorkspace
This set of MCP mappings was designed for MC 1.8.8. Use at your own peril.
#################################################
ForgeGradle 2.1-SNAPSHOT-75bb646
https://github.com/MinecraftForge/ForgeGradle
#################################################
Powered by MCP unknown
by: Searge, ProfMobius, Fesh0r,
R4wk, ZeuX, IngisKahn, bspkrs
#################################################
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project '189EclipseCraft'.
> Could not resolve all dependencies for configuration ':deobfCompile'.
> Could not resolve mezz.jei:jei_1.8.9:2.28.5.172.
Required by:
com.sjoopies.eclipsecraft:189EclipseCraft:1.0
> Could not resolve mezz.jei:jei_1.8.9:2.28.5.172.
> Could not get resource 'https://libraries.minecraft.net/mezz/jei/jei_1.8.9/2.28.5.172/jei_1.8.9-2.28.5.172.pom'.
> Could not GET 'https://libraries.minecraft.net/mezz/jei/jei_1.8.9/2.28.5.172/jei_1.8.9-2.28.5.172.pom'. Received status code 403 from server: Forbidden
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 11.214 secs
I also downloaded the mod and put it in the mods folder of my workspace and in the lib folder too
-
When ever I run my mod my block always looks like a cube instead of its model
Also this is printed out in the console:
OBJLoader.Parser: command 's' (model: '[My model location]') is not currently supported, skipping
this is my code for rendering:
package com.sjoopies.eclipsecraft.client.renderer;
import java.io.IOException;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.Attributes;
import net.minecraftforge.client.model.IModel;
import net.minecraftforge.client.model.ModelLoaderRegistry;
import net.minecraftforge.client.model.TRSRTransformation;
import net.minecraftforge.client.model.obj.OBJLoader;
import org.lwjgl.opengl.GL11;
import com.google.common.base.Function;
import com.sjoopies.eclipsecraft.ref.ECRef;
public class CyrstalRenderer extends TileEntitySpecialRenderer {
public static final ResourceLocation texture = new ResourceLocation(ECRef.MODID + ":" + "textures/blocks/crystal.png");
private static final ModelResourceLocation loc = new ModelResourceLocation(ECRef.MODID + ":" + "models/block/crystal.obj");
Function<ResourceLocation, TextureAtlasSprite> textureGetter = new Function<ResourceLocation, TextureAtlasSprite>() {
public TextureAtlasSprite apply(ResourceLocation location) {
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
}
};
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) {
Tessellator tessellator = Tessellator.getInstance();
this.bindTexture(texture);
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
// GL11.glRotatef(i++, 0.0f, 0.0f, 1.0f);
IModel crystalModel = null;
try {
crystalModel = OBJLoader.instance.loadModel(loc);
} catch (IOException e) {
crystalModel = ModelLoaderRegistry.getMissingModel();
e.printStackTrace();
}
IBakedModel bakedModel = crystalModel.bake((TRSRTransformation.identity()), Attributes.DEFAULT_BAKED_FORMAT, textureGetter);
worldRenderer.begin(7, Attributes.DEFAULT_BAKED_FORMAT);// StartDrawingQuads
List<BakedQuad> generalQuads = bakedModel.getGeneralQuads();
System.out.println(generalQuads);
for (BakedQuad q : generalQuads)
{
int[] vd = q.getVertexData();
worldRenderer.addVertexData(vd);
}
for (EnumFacing face : EnumFacing.values())
{
List<BakedQuad> faceQuads = bakedModel.getFaceQuads(face);
for (BakedQuad q : faceQuads)
{
int[] vd = q.getVertexData();
worldRenderer.addVertexData(vd);
}
}
tessellator.draw();
GL11.glPopMatrix();
}
}
-
I tried the getExtendedState and it did not work the way I wanted it to. Can anyone else give me a solution to my problem?
-
Does it update every tick? Because I want the tileEntity to control the rotation.
-
I rendered my block with no errors except my "block" is a cube. I used this method because It allows me to rotate the block using OpenGL
This is my rendering Code:
public class CyrstalRenderer extends TileEntitySpecialRenderer {
public static final ResourceLocation texture = new ResourceLocation(ECRef.MODID + ":" + "textures/blocks/crystal.png");
private static final ModelResourceLocation loc = new ModelResourceLocation(ECRef.MODID + ":" + "models/block/crystal.obj");
Function<ResourceLocation, TextureAtlasSprite> textureGetter = new Function<ResourceLocation, TextureAtlasSprite>() {
public TextureAtlasSprite apply(ResourceLocation location) {
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
}
};
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) {
Tessellator tessellator = Tessellator.getInstance();
this.bindTexture(texture);
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glRotatef(45, 0.0f, 0.0f, 1.0f);
IModel crystalModel = null;
try {
crystalModel = OBJLoader.instance.loadModel(loc);
} catch (IOException e) {
crystalModel = ModelLoaderRegistry.getMissingModel();
e.printStackTrace();
}
IBakedModel bakedModel = crystalModel.bake((TRSRTransformation.identity()), Attributes.DEFAULT_BAKED_FORMAT, textureGetter);
worldRenderer.begin(7, Attributes.DEFAULT_BAKED_FORMAT);// StartDrawingQuads
List<BakedQuad> generalQuads = bakedModel.getGeneralQuads();
for (BakedQuad q : generalQuads)
{
int[] vd = q.getVertexData();
worldRenderer.addVertexData(vd);
}
for (EnumFacing face : EnumFacing.values())
{
List<BakedQuad> faceQuads = bakedModel.getFaceQuads(face);
for (BakedQuad q : faceQuads)
{
int[] vd = q.getVertexData();
worldRenderer.addVertexData(vd);
}
}
tessellator.draw();
GL11.glPopMatrix();
}
}
-
I have a block and it is using an OBJ file and everything works except I want to rotate it depending on the time. I tried different things but I could not get it to work.
-
never mind I was being stupid
-
Where do I put them
-
I tried using the arguments "--username=" and "--password=" in my dev environment, but I get the error
Unrecognized option: --username=(my user name is here)
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I'm using Forge-1.8.9-11.15.0.1702
-
I tried
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(CPMBlocks.adv_furnace), 0, new ModelResourceLocation("stone", "inventory"));
but it only renders the texture in inventory.
Is there any thing I have to call to render texture the block in world
-
no problem
-
replace:
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
return true;
}
with:
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
return type != ItemRenderType.INVENTORY;
}
-
I am trying this with my mod right now to see how you can do it
-
What do you mean
-
put this --> health_potion = new ModelRenderer(this, 0, 0);
above this --> health_potion.mirror = true;
Its in the model class
-
can you now show me your ClientProxy, ModelCrystal, and RenderHealthCrystal
-
show me the crash report
[1.8.9] How can I get the entity I'm looking at on server side
in Modder Support
Posted
I thought you meant onItemInteractWithEntity, thanks for your help.