Jump to content

Recommended Posts

Posted

Good evening,

 

I'm trying to make more wall blocks (from BlockWall class), for now it does work but I feel I am doing it the wrong way. Here is a screenshot of what I accomplished from now :

 

width=800 height=449http://s11.postimg.org/ptxdoyv83/2016_03_09_19_56_27.png[/img]

 

At first thoughts, I felt that I had to extend the BlockWall class to get a full compatibility between my custom walls and the basic ones (regarding blocks connections for example). When I did this, I encountered some problems : I couldn't add values to the EnumType inside the BlockWall class. So I decided to make my own PropertyEnum but then it crashed because it obivously waited for the default EnumType and not my custom one.

 

On second thoughts, I decided to copy the BlockWall class and I changed the EnumType class to implement my own one, changing some values moreover. There I dunno why but I couldn't access to some protected final variable from Block class (yet, I extended my custom one from Block) so I had to put some "default" values for hardness or resistance (if you don't know what I mean, take a look at the BlockWall constructor for setHardness and setResistance, etc). It does work for now, but I feel that this way is not the right one, furthermore the maintainability or the .json blockstates is awful (see the file).

 

Did everyone achieve this with an easier way ? Do you have some tips to give me to facilitate the work I've already done and so make it more maintainable ?

 

Oh and for last, I have a little problem here that I encountered with another block (BlockCrop) too : when registering the models, it can't find the model definition for inventory :

 

Model definition for location questsystem:block_wall_custom#inventory not found

 

But it registers the other models sucessfully. I saw in some codes that I can manually put the "inventory" variant in the .json file but I was wondering if it was the right way ?

 

BlockWallCustom.java

ItemBlockMeta.java

 

BlockWallCustomVariants.java

block_wall_custom.json

 

Thank you in advance for your help :)

 

UPDATE1: fixed inventory registration, I just forgot the .json file in the models/item folder, I'm a bit ashamed.  :-[ Finally, it does not work, lel.

Squirrel ! Squirrel ! Squirrel !

Posted

I've made this exact mod (except that I did not use netherbrick, which is too dark for my taste). BTW, Netherbrick in the crafting shape of a vanilla wall will craft a vanilla netherbrick fence. What were you planning for your recipes?

 

Another irritating feature of vanilla walls is that they won't join up with subclassed walls (the test is for '== BlockWall', not 'instanceof'). Likewise subclassed gates. I ended up adding my own cobble and mossy-cobble walls after distinguishing my recipe to make 7 walls from 7 blocks (I added a cap to the top center).

 

In addition, if you try to vary hardness by metadata, you may need to guard against having your hardness method called against an air block (when breaking blocks, vanilla seems to make one last call to get hardness after replacing a block with air).

 

Take a look at uncle jeff's anystone walls (my extra walls mod). There are two sets of 16 walls in the version for 1.8.

 

I ported to 1.8.9 but haven't uploaded that yet because I ran into problems moving my world from 1.8 to 1.8.9 for client-server final testing. However, I could stick it on Curse Forge as an alpha if you want to try it.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Posted

Thank you for your reply jeffryfisher,

 

It seems that Minecraft has a non-dev-friendly side in there.

 

About the recipes, I think I will just use 1.9 fence patterns to make my walls recipes, and when i will update to 1.9, I will reverse the process.

Squirrel ! Squirrel ! Squirrel !

Posted

It seems that Minecraft has a non-dev-friendly side in there.

If you think walls are unfriendly, just try adding a new horse armor  :o  It's almost as if Mojang's coders didn't plan for future modders when they wrote the vanilla code  :P

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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

    • I want to create block with entity, that will have height of 3 or more(configurable) and I tried to change first VoxelShape by increasing collision box on height I want and for changing block height on visual side i tried to configure BlockModelBuilder:  base.element() .from(0, 0, 0) .to(16f, 48f, 16f) .face(Direction.UP).texture("#top").end() .face(Direction.DOWN).texture("#bottom").end() .face(Direction.NORTH).texture("#side").end() .face(Direction.SOUTH).texture("#side").end() .face(Direction.WEST).texture("#side").end() .face(Direction.EAST).texture("#side").end() .end(); but, getting crash with next error: Position y out of range, must be within [-16, 32]. Found: %d [48.0]; Looks like game wont to block height modified by more than 32. Is there any way to fix that problem?
    • As long as the packets you are sending aren't lost, there's nothing wrong with what you're currently doing. Although, this sounds like something that would benefit from you making your own datapack registry instead of trying to arbitrarily sync static maps. Check out `DataPackRegistryEvent.NewRegistry`.
    • Hey all, I've been working a lot with datapacks lately, and I'm wondering what the most efficient way to get said data from server to client is.  I'm currently using packets, but given that a lot of the data I'm storing involves maps along the lines of Map<ResourceLocation, CustomDataType>, it can easily start to get messy if I need to transmit a lot of that data all at once. Recently I started looking into the ReloadableServerResources class, which is where Minecraft stores its built-ins.  I see you can access it via the server from the server's resources.managers, and it seems like this can be done even from the client to appropriately retrieve data from the server, unless I'm misunderstanding.  However, from what I can tell, this only works via built-in methods such as getRecipeManager() or getLootTables(), etc.  These are all SimpleJsonResourceReloadListeners, just like my datapack entries are, so it seems like it could be possible for me to access my datapack entries similarly?  But I don't see anywhere in ReloadableServerResources that stores loaded modded entries, so either I'm looking in the wrong place or it doesn't seem to be a thing. Are packets really the best way of doing this, or am I missing a method that would let me use ReloadableServerResources or something similar?
    • Hi, everyone! I'm new to minecraft modding stuff and want ask you some questions. 1. I checked forge references and saw there com.mojang and net.minecraft (not net.minecraftforge) and as I understand it's original game packages with all minecraft logic inside including renderers and so on, right? 2. Does it mean that forge has a limited set of instruments which doesn't cover all the aspects of the game? If make my question more specific then does forge provide such instruments that allow me totally change minecraft itself, like base mechanics and etc.? Or I have to use "original game packages" to implement such things? 3. I actively learning basic concepts with forge documentation and tutorials. So in my plans make different inventory system like in diabloids. Is that possible with forge? 4. It is last question related to the second one. So how deeply I can change minecraft with forge? I guess all my questions above because of that I haven't globally understanding what forge is and how it works inside and how it works with minecraft. It would be great if you provide some links or topics about it or explain it by yourself but I guess it's to big to be explained in that post at once. Anyway, thank you all for any help!
    • Im trying add to block a hole in center, just a usual block and in center of it on up side, there is should be a hole. I tried to add it via BlockModelBuilder, but its not working. Problem is that it only can change block size outside. I tried it to do with VoxelShape and its working, but its has been on server side and looks like its just changed collision shape, but for client, there is a texture covering this hole. I tried to use: base.renderType("cutout"); and removed some pixels from texture. I thought its should work, but game optimization makes block inside looks transparent. So, only custom model?
  • Topics

×
×
  • Create New...

Important Information

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