Jump to content

shucke

Members
  • Posts

    126
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    Pet Mastery!

shucke's Achievements

Creeper Killer

Creeper Killer (4/8)

9

Reputation

  1. Hi everyone, I am currently having an issue getting my OBJ model to load. The error i am getting is: I don't have much experience with blockstates and the new model rendering pipeline and don't really now where to go from here. this is my blockstate file: I also added OBJLoader.INSTANCE.addDomain(Ref.MOD_ID); in my client proxy. The location of my .obj file is: assets\temporia\models\block\temporite.obj I'm sorry if this is a common issue and is easy to find a fix for but i couldn't find anything that worked for me. Thanks in advance.
  2. I am trying to implement leaves and i ran into a bit of a annoying problem. I don't want my block to look up different models for the various block states that it has (Being the decayable and check_decay from the leave block). But it is looking for those different variants in the blockstate class. Now since the minercraft leave blocks don't use different states in the blockstate i was wondering how i can do that for my leaves. Thanks in advance.
  3. Tinkers construct is an open source mod, if you want to make your glass like it look at the code to see how they have done it and try to replicate it. Do not straight up copy the code because it will get you nowhere.
  4. I need a way to render a block normally but from the TileEntitySpecialRenderer. I need this because i need to apply a rotation to it. I currently have this: private void renderWaterWheel(TileWaterWheel tile, double posX, double posY, double posZ, float partialTick){ GlStateManager.pushMatrix(); World world = tile.getWorld(); IBlockState state = tile.getBlockState(); BlockPos pos = tile.getPos(); GlStateManager.rotate(0.0F, 0.0F, 1.0F, tile.rotation); IFlexibleBakedModel model = (IFlexibleBakedModel) mc.getBlockRendererDispatcher().getModelFromBlockState(state, world, pos); mc.getBlockRendererDispatcher().getBlockModelRenderer().renderModel(world, model, state, pos, Tessellator.getInstance().getWorldRenderer()); GlStateManager.popMatrix(); } @Override public void renderTileEntityAt(TileEntity tile, double posX, double posY, double posZ, float partialTick, int i0) { renderWaterWheel((TileWaterWheel) tile, posX, posY, posZ, partialTick); } But this doesnt work. Anyone knows how to do it properly?
  5. Aaahhh thanks for the explanation So now i checked in the block if the item held is an instance of an Wrench and all works well now. Thanks for helping out!
  6. So i put the !world.isRemote check and it turns out the method does not get called on the servers side. I thought it would because it doesn't have a SideOnly annotation. I already tried the onItemUse method but that doesn't seem to call when i right click the desired block. Is there another method that does the same thing as the onItemUseFirst method?
  7. oops my bad here it is public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ){ Block block = world.getBlockState(pos).getBlock(); if(block instanceof IRotateable){ EnumFacing facing = ((IRotateable) block).getDirection(world, pos); ((IRotateable) block).setRotation(world, pos, DirectionHelper.getNext(facing)); System.out.println(((IRotateable) block).getDirection(world, pos)); return true; } return false; }
  8. Title said it all actually, my block state resets when i right click on it with an empty hand. So this is the block code. public abstract class BlockRotateable extends BlockBaseContainer implements IRotateable{ public static final PropertyEnum DIRECTION = PropertyEnum.create("direction", EnumFacing.class); public BlockRotateable(String name, Material material) { super(name, material); this.isBlockContainer = true; } public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { return true; } public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer){ return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(DIRECTION, facing); } public final EnumFacing getDirection(World worldObj, BlockPos pos){ return (EnumFacing) worldObj.getBlockState(pos).getValue(DIRECTION); } @Override public void setRotation(World world, BlockPos pos, EnumFacing rotation) { IBlockState state = world.getBlockState(pos).withProperty(DIRECTION, rotation); world.setBlockState(pos, state); } public IBlockState getStateFromMeta(int meta){ return this.getDefaultState().withProperty(DIRECTION, DirectionHelper.byIndex(meta)); } public int getMetaFromState(IBlockState state){ return ((EnumFacing)state.getValue(DIRECTION)).getIndex(); } protected BlockState createBlockState(){ return new BlockState(this, new IProperty[] {DIRECTION}); } } Im probally missing something but i cant figure out what. Any help is much appreciated EDIT: i am using the onItemUseFirst method in a item class to change the block state.
  9. So im trying to register 2 different items with metadata sensitve models. Now it finds the model and all but the models for the second item appear on the first item. I cant seem to find the error in this, mainly because i haven't done this before with 1.8. So here is the registering code: private void registerFishItemModels(){ List<String> rawFishModelNames = new ArrayList(); List<String> cookedFishModelNames = new ArrayList(); for(int i = 0; i < FishRegistry.getFishTypeList().length; i++){ FishType fish = FishRegistry.getFishFromID(i); if(fish == null) continue; String s = JUtils.capitalize(fish.fishName); String rawName = Fishing.ID + ":fish" + s + "Raw"; registerItemModelWithMeta(FishingItems.rawFish, i, rawName); rawFishModelNames.add(rawName); if(fish.isCookable()){ String cookedName = Fishing.ID + ":fish" + s + "Cooked"; registerItemModelWithMeta(FishingItems.cookedFish, i, cookedName); cookedFishModelNames.add(cookedName); } } ModelBakery.addVariantName(FishingItems.rawFish, JUtils.convertStringList(rawFishModelNames)); ModelBakery.addVariantName(FishingItems.cookedFish, JUtils.convertStringList(cookedFishModelNames)); } private void registerItemModelWithMeta(Item item, int meta, String loc){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(FishingItems.rawFish, meta, new ModelResourceLocation(loc, "inventory")); } *The JUtils class is just an helper class to convert a list to array So the models for the cooked fish appear on the raw fish and non appear on the raw fish. Any help would be greatly apreciated because i cant seem to figure it out.
  10. Ok so i thought the model location worked the same as resource location. turns out not to be the case works fine now!
  11. So updating to 1.8 was overall not that difficult for me. Only problem i encountered was with the way rendering works now. I am currently trying to allow my item to have a custom model. I have created a JSON model in BDCraft Cubik PRO so im assuming there aren't any problems with the model. The problem im having now is that i dont get any errors but the model isn't showing. So in my client proxy i have this: public void postInitialize(){ registerItemModel(FishingItems.crabCage, new ModelResourceLocation(Fishing.ID + ":models/", "crab_cage")); super.postInitialize(); } public void registerItemModel(Item item, ModelResourceLocation model){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, new ItemMeshDefinition(){ @Override public ModelResourceLocation getModelLocation(ItemStack stack) { return model; } }); } So i dont know where to start since im still new to 1.8 and got no errors and the methods are getting called aswell. *I noted that i doesnt matter if i change the name in my model resource location, it always goes points the the unlocalized name of the item
  12. Yeah i am leaning towards the idea of registering a world for every dungeon type. And generating them 1000 blocks apart or something, depending on the size.
  13. I would suggest creating an IExtendEntityProperties for the player. Create some custom effects, store them somewhere, and add them to a list in the extended properties when a player drinks a potion for example. Create a method in your extended properties to be called onUpdate or something. Use a tick event to call the method. Check in the method for effects. Do whatever you want to happen. example: public class PlayerProperties implements IExtendedEntityProperties{ private EntityPlayer thePlayer; private List<Effect> effects = new ArrayList(); public PlayerProperties(EntityPlayer player){ thePlayer = player; } public void onUpdate(){ for(int i = 0; i < effects.size(); i++){ Effect effect = effects.get(i); effect.execute(thePlayer); effect.time--; if(effect.time == 0) effects.remove(i); } } public void addEffect(int id, int time){ effects.add(new Effect(id, time)); } } if you want more info on how to create IExtendedEntityProperties check out the tutorial from CoolAlias on the minecraft forum.
  14. Sorry should have been more clear. RPG Dungeon system Like when a party enters a dungeon it creates an dungeon specified to that party so only party members can join that instance of the dungeon. World at Warcraft dungeons for example, maybe i should have said dungeons in the first place...
  15. So yeah title says it, how do i go about creating a temporary world? my goal is to create RPG instance system but i dont know how to world handling would be for that. My idea was to create a world with a certain id and store it in the player's data, when the player enters a instance. And that the world will be "deleted" when the player leaves the world. Any thoughts on how i would acomplish this?
×
×
  • Create New...

Important Information

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