Everything posted by NecroTheif
-
[1.8.9] OBJ Model Block Not working?
Okay, but why doesn't the model work in the inventory when I use ModelLoader?
-
[1.8.9] OBJ Model Block Not working?
Oh, I figured it out. If I ItemModelMesher#register, instead of ModelLoader.setCustomModelResourceLocation It works in both the inventory and the world. Is there any reason I shouldn't use ItemModelMesher#register?
-
[1.8.9] OBJ Model Block Not working?
I didn't realize that it had to set the state map in preInit It had it in Init. That fixed it! Thanks! But now it doesn't work in the inventory?
-
[1.7.10] Add recipes for every item that extends a specific class
For getting a free enchantment id, you could always loop through the enchantmentsList array until you get to a null value and use that index as the id.
-
[1.8.9] OBJ Model Block Not working?
That still didn't seem to work... So I was looking over the mbe05 example again and it turns out I don't even need the ModelBakeEvent since I'm using a custom ModelLoader but it doesn't seem to work. blockstate json { "variants": { "normal": { "model": "cwm:Gemstone.obj" } } } Setting StateMap on Load OBJLoader.instance.addDomain(RefValues.MOD_ID); StateMapperBase objState = new StateMapperBase() { @Override protected ModelResourceLocation getModelResourceLocation(IBlockState iBlockState) { return new ModelResourceLocation(RefValues.MOD_ID+":"+RefValues.RUBY+RefValues.GEMSTONE); } }; ModelLoader.setCustomStateMapper(Gemstone.getGemstone(RefValues.RUBY), objState); Setting Item Renderer Item item = Item.getItemFromBlock(Gemstone.getGemstone(RefValues.RUBY)); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(RefValues.MOD_ID+":"+RefValues.RUBY+RefValues.GEMSTONE)); Relevant console output [12:29:53] [Client thread/ERROR] [FML]: Model definition for location cwm:rubyGemstone#facing=north not found [12:29:53] [Client thread/ERROR] [FML]: Model definition for location cwm:rubyGemstone#facing=east not found [12:29:53] [Client thread/ERROR] [FML]: Model definition for location cwm:rubyGemstone#facing=south not found [12:29:44] [Client thread/ERROR] [FML]: Model definition for location cwm:rubyGemstone#facing=down not found [12:29:44] [Client thread/ERROR] [FML]: Model definition for location cwm:rubyGemstone#facing=west not found [12:29:44] [Client thread/ERROR] [FML]: Model definition for location cwm:rubyGemstone#facing=north not found
-
[1.8.9] OBJ Model Block Not working?
I tried adding my own custom state mapper but it doesn't seem to do anything? @SubscribeEvent public void ModelBakeEvent(ModelBakeEvent event){ StateMapperBase ignoreState = new StateMapperBase() { @Override protected ModelResourceLocation getModelResourceLocation(IBlockState iBlockState) { return new ModelResourceLocation(RefValues.MOD_ID+":"+RefValues.RUBY+RefValues.GEMSTONE); } }; ModelLoader.setCustomStateMapper(Gemstone.getGemstone(RefValues.RUBY), ignoreState); try { Function<ResourceLocation, TextureAtlasSprite> textureGetter = new Function<ResourceLocation, TextureAtlasSprite>() { public TextureAtlasSprite apply(ResourceLocation resourceLocation) { return Minecraft.getMinecraft().getTextureMapBlocks().registerSprite(resourceLocation); } }; OBJModel model = (OBJModel) OBJLoader.instance.loadModel(new ResourceLocation(RefValues.MOD_ID+":models/obj/Gemstone.obj")); IBakedModel baked = model.bake(model.getDefaultState(), Attributes.DEFAULT_BAKED_FORMAT, textureGetter); event.modelRegistry.putObject(new ModelResourceLocation(RefValues.MOD_ID+":"+RefValues.RUBY+RefValues.GEMSTONE, "inventory"), baked); } catch (IOException e) { e.printStackTrace(); } }
-
[1.8.9] OBJ Model Block Not working?
I am trying to use the OBJLoader to load and obj model in one of my blocks but for some reason it only works for the item itself and not the block? If I change the ModelResourceLocation from inventory to normal neither works? I tried to look at the mbe05 example but nothing seems to be wrong: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe05_block_smartblockmodel2 My ModelBakeEvent: @SubscribeEvent public void ModelBakeEvent(ModelBakeEvent event){ try { Function<ResourceLocation, TextureAtlasSprite> textureGetter = new Function<ResourceLocation, TextureAtlasSprite>() { public TextureAtlasSprite apply(ResourceLocation resourceLocation) { return Minecraft.getMinecraft().getTextureMapBlocks().registerSprite(resourceLocation); } }; OBJModel model = (OBJModel) OBJLoader.instance.loadModel(new ResourceLocation(RefValues.MOD_ID+":models/obj/Gemstone.obj")); IBakedModel baked = model.bake(model.getDefaultState(), Attributes.DEFAULT_BAKED_FORMAT, textureGetter); event.modelRegistry.putObject(new ModelResourceLocation(RefValues.MOD_ID+":"+RefValues.RUBY+RefValues.GEMSTONE, "inventory"), baked); } catch (IOException e) { e.printStackTrace(); } }
-
[1.8] Change Color or Tint Blocks
That's what I thought but which event? The RenderBlockOverlayEvent doesn't seem to ever get created?
-
[1.8] Change Color or Tint Blocks
Is it possible to change the color of a block in the world, or tint it a certain color. I mean only the one Block in the world. For Example: Change the sand I'm currently looking at to green (But not any other sand in the world).
-
[1.8][SOLVED]Adding Icons that switch when a certain condition is met
You could just create the gui with a different texture depending on what opened it.
-
[1.8] Keypress to open crafting table
I'm trying to have a keypress open a crafting table but whenever I do it the crafting table GUI is messed up in the sense that every item is one to the right of where I have to click to pick it up and placing items in the crafting table equips them to the player (depending on the slot). public void onKeyInput(InputEvent.KeyInputEvent event) { if(KeyBindings.craftingButton.isPressed()){ EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; BlockWorkbench.InterfaceCraftingTable craftingTable = new BlockWorkbench.InterfaceCraftingTable(player.worldObj, player.playerLocation); player.displayGui(craftingTable); } }
-
Can't open inventory tabs in Forge Sever. Please help.
Then why does it work when I use a 1.7.10 cauldron server? I would really rather not use cauldron but it won't let me access the tabs in a forge server 1.7.10
-
Can't open inventory tabs in Forge Sever. Please help.
But they are all added with forge the same way. I was wondering if I was setting up the server wrong or something because I have seen it work on other servers.
-
Can't open inventory tabs in Forge Sever. Please help.
I'm trying to set up a modded server but whenever I add a mod that has a tab in the survival inventory I can't open it up. For example I can't open the tab for baubles in thaumcraft, the tab for galaticraft, or the tab for tinker's construct. All these tabs work in single player but once I join the server none of them work. I have tried just using each mod and it still doesn't work for any of them. There is no error printed to the console it just doesn't open. Please help. I am using Minecraft 1.7.10 forge server.
-
[1.7.10]Turn a file into a resourcelocation
No, the client would grab them from the sever whenever it needed them
-
[1.7.10]Turn a file into a resourcelocation
I am trying to make it so that the sound files (and other resources) are on the server so that the client can't reach them
-
[1.7.10]Turn a file into a resourcelocation
Here is the code for calling the Resource pack (where i used to set the severFolder field) message.getMessage() returns the sever folder: Field field=null; try { field = Minecraft.class.getDeclaredField("defaultResourcePacks"); field.setAccessible(true); ((List<IResourcePack>) field.get(Minecraft.getMinecraft())).add(new FolderResourcePack(new File(message.getMessage()))); field.setAccessible(false); } catch (Exception e) { /* Should not happen */ e.printStackTrace(); } finally { if(field!=null)field.setAccessible(false); } Minecraft.getMinecraft().refreshResources();
-
[1.7.10]Turn a file into a resourcelocation
This is where I try to play the sound: MovingSoundRecord sound = new MovingSoundRecord(new ResourceLocation("regions:"+message.getMessage()), 1f, 1, true, 0); Minecraft.getMinecraft().getSoundHandler().playSound(sound); This is MovingSoundRecord @SideOnly(Side.CLIENT) public class MovingSoundRecord extends PositionedSound{ public MovingSoundRecord(ResourceLocation location, float volume, float pitch, boolean repeat, int reapeatDelay) { super(location); this.volume = volume; this.field_147663_c = pitch; this.xPosF = 0; this.yPosF = 0; this.zPosF = 0; this.repeat = repeat; this.field_147665_h = reapeatDelay; this.field_147666_i = ISound.AttenuationType.NONE; } public void setVolume(float volume){ this.volume = volume; } }
-
[1.7.10]Turn a file into a resourcelocation
Thanks for the advice! I used that instead of RegionPack and just passed it serverFolder, but i'm still getting this message: [15:37:43] [Client thread/WARN]: Unable to play unknown soundEvent: regions:Death Whenever the player joined the sever.
-
[1.7.10]Turn a file into a resourcelocation
Okay, I made the pack and added it but whenever i try to play a sound with ResourceLocation = new ResourcLocations("regions:Death"); is says unable to play unknown soundEvent: regions:Death IResourcePack source: package com.necrolore.regionmod.resourcepack; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashSet; import java.util.Set; import com.google.common.collect.ImmutableSet; import net.minecraft.client.resources.IResourcePack; import net.minecraft.client.resources.data.IMetadataSection; import net.minecraft.client.resources.data.IMetadataSerializer; import net.minecraft.server.MinecraftServer; import net.minecraft.util.ResourceLocation; public class RegionPack implements IResourcePack{ public static String serverFolder; @Override public InputStream getInputStream(ResourceLocation region) throws IOException { if(serverFolder==null) return null; return new FileInputStream(new File(serverFolder+"/assets/regions/sounds/"+region.getResourcePath()+".ogg")); } @Override public boolean resourceExists(ResourceLocation region) { return serverFolder!=null && new File(serverFolder+region.getResourcePath()).exists(); } @Override public Set getResourceDomains() { return ImmutableSet.of("regions"); } @Override public IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { return null; } @Override public BufferedImage getPackImage() throws IOException { return null; } @Override public String getPackName() { return "Regions"; } } sounds.json { "regions:Death": { "category": "region", "sounds": [ { "name": "Death", "stream": true } ] } }
-
[1.7.10]Turn a file into a resourcelocation
Okay, I was able to create most of it, I just don't know what to put for this method. getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_)
-
[1.7.10]Turn a file into a resourcelocation
So that you can create objects based on the number of files put in the folder, not create images based on the number of objects. How would you would you do that ^ ?
-
[1.7.10]Turn a file into a resourcelocation
I can think of two reasons why. One to put all the files on the sever to save space on the client and two, to make it easier to add textures to the game. How would you do that?
-
Static method registers and creates Item a bad idea?
It does work, I am calling this static method in the PreInit method in my main class. I was just wondering why this would be a bad idea? I was told by a friend that it was a bad idea because of the way forge registers items but he didn't know any more than that. I was wondering why it's a bad idea?
-
Static method registers and creates Item a bad idea?
I was told that it was a bad idea to create a method like this in a class FakeIce that extends Item class and then call this method in the main class. Why would that be a bad idea? /** * Initializes, creates, and registers fake ice */ public static void initialize(){ /* Initialize, create, and register the ice */ ice = new FakeIce(); ice.setUnlocalizedName(Blocks.ice.getUnlocalizedName().substring(5)); ice.setCreativeTab(CreativeTabs.tabAllSearch); ice.setHardness(0.5F); ice.setLightOpacity(3); ice.setStepSound(soundTypeGlass); GameRegistry.registerBlock(ice, Blocks.ice.getUnlocalizedName().substring(5)); }
IPS spam blocked by CleanTalk.