Coldcraft Per Diem 2

I got to say… the project had a lot of progress since the last post about it. In fact, I need to see what was included the last time I wrote. Wait please… I’m ready.

As always, the full project is available in GitHub

  • Well lets start it simple. A .lang archive was made to give proper names for our blocks in game. This was needed because the previous test_block did evolve to a campfire, and we didn’t like the in-game name was coldcraft.blocks.tile… and it displays just Campfire.
    Screenshot from 2016-04-25 11-24-39
  • A recipe to the block was added, called ModCrafting.class. It’s simple. The recipe is defined in a pattern. Everything is added to the common load order in the Init phase.
    Screenshot from 2016-04-25 12-10-15
  • The PlayerData.class was made with the objective to create the attribute Temperature. This is a very long class to post and image of everything, so if you want, please click on the link to GitHub to see it all. Still, I will explain it.
    Basically, first some properties of the class are stated, along with the constructor of the extended data of the player, and methods to assign the properties to the player. When calling a method of this class, the id of the entity holding the properties must be provided using: public static PlayerData get(EntityPlayer player)
    Screenshot from 2016-04-25 11-51-34Then we have some methods that save the properties as NBT Data (Where the data regarding of Minecraft is saved). Sadly those doesn’t work as expected or maybe we don’t now what we are doing.
    Then, the interactions are stated. I’m just going to write about the first one (The other hasn’t been tested). campTemperature it’s called by the campfire (Explained below), it increases the temperature by 0.001 per tick until a limit of 6.
    Screenshot from 2016-04-25 11-56-10
    Lastly, setTemperature and getTemperature methods. SyncTemperature is used everytime the temperature is setted. This is needed to actually display and save the temperature. The syncing is handled by a handler (Too complex, I just need to say that is works)
    Screenshot from 2016-04-25 12-00-42
  • The Campfire (Previously named test_block), now it isn’t just a block, is a Tile Entity. This makes available a whole lot of functionality to the block, making available the update() method, which is called every in-game tick so it can do stuff. One important thing is that the block class still exists. This happens on the ModTileEntity.class (Its unique at the moment, thats why the generic name)
    Screenshot from 2016-04-25 11-31-59.pngBasically, each tick Minecraft gets the location of the block, creates an area with a “apothem” of 4 blocks, checks if and entity of the type EntityPlayer (This means it looks for players) is in that area, and if true, calls the campTemperature() method in the Player Extended Properties, which as explained, increases the temperature.
    Screenshot from 2016-04-25 11-36-44And well, as always, the tile (Or anything) must be registered into Forge and Minecraft in the ModTileEntities.class… and into the Forge loading order: The TileEntity is added to the Common Proxy in the preInit, and the regular block and textures stayed the same.
  • A GUI was made to display information about the temperature (GuiTempBar.class), we can call it thermometer. Currently it displays on real-time the temperature, and has a button that closes the interface.
    Screenshot from 2016-04-25 12-25-10.pngScreenshot from 2016-04-25 12-26-24There is also the ModGuiHandler.class (Basically is gives permission to the server and client to display things) and everything is added to the common load order in the Init phase.
  • 4 items were made (3 for testing) in the ModItems.class. The important one is the one that opens the Thermometer/Temperature GUI for the player. Those are added to the common load order in the preInit phase and their textures (which are none) to the client load order in the init phase.
    Screenshot from 2016-04-25 12-14-35.png
    The item uses the event onItemRightClick to do stuff. (More events things explained below)
  • Finally, the EventHandlerCommon.class , here when the player joins to world or changes of map (Ender, Nether or regular) loads the temperature attribute, but it doesn’t quite work, we guess is because the playerID changes sometimes the game starts.
    LivingUpdateEvent.class is an event that happens every tick if a living entity exist. This will be used to update the temperature of the player depending on the biome he exists, for each tick.

I guess it would be nice a photo of the common load order CommomProxy.class:

Screenshot from 2016-04-25 12-40-13.png

And, that is all for now. We are currently working on:

  • Updating the temperature of the player according to the biome.
  • Deal damage
  • Do some armor/sweaters

For more information, you know where to find me… or my team (Santiago Kelley and Arturo Fornes).

Peace.

😀

Anuncios

My thoughts on James Gosling – WSQ13

Next: Triangulation 245: James Gosling interview. James Gosling, creator of Java language (He implemented the language and the virtual machine). My thoughts that I got of the video:

  • Java is born based on the idea that the companies were missing the transition from the usage of components in computers to use them in everything. They thought out of the box and designed a language that would be used in everything.

BTW, the video is missing 50 minutes of content. Don’t know why…

Well…. Now there are no more videos.

“But remember my dear friend: Its not good-bye, oh no, its never good-bye, its see you later (you’re pretty darn awesome)” (Jake Roper Vsauce3’s host):

5662924328_d07f42301b_b
flickr photo by 43158397@N02 https://www.flickr.com/photos/43158397@N02/5662924328 obtained under a Creative Commons (BY)

My thoughts on Ward Cunningham – WSQ12

Well, after watching Triangulation 239: Ward Cunningham the inventor of the wiki, part of the SmallTalk community, contributor to programming patterns, Eclipse and Relic. My thoughts and what I got of the video:

  • “Wikis are a different kind of thinking on the web”. Instead of the typical publication where the reader can’t be also the writer, wikis explodes that concept. The reader is also the core of the writing process, it’s him who writes. The community should work together (Scientists, engineers, artists, anyone in general) to construct “monuments” like Wikipedia, even with its upsides and downsides, but it’s the biggest but simplest archive of information in the web.
  • XP programming. This is got mainly because of Software Engineering Fundaments course with Sherif Kassem. Now evrytime I hear XP Programming, I intermediately think: An agile, fast development, project style. It’s iterative, and there is programmed feedback cycles, it involves a lot of testing. Theres is a lot of process but it can show the works basically from the start (Not like waterfall models, where nothing works until the end).
    The first wiki Cunningham made was an activist site for people interested in computing patterns using XP Programming.
    Among other concepts I’ve learned in Sherif’s class, refactoring, pair programming, testing were also mentioned in the interview.
  • Programming patterns are a solution for a problem that can be used multiple times in design and object oriented programming (SmallTalk was referenced a lot). They showed the relation between classes and objects using CRC Cards.

Well…. that’s everything… for now.

“But remember my dear friend: Its not good-bye, oh no, its never good-bye, its see you later (you’re pretty darn awesome)” (Jake Roper Vsauce3’s host):

1152595430_d7df3245a3_o
flickr photo by kevlar https://www.flickr.com/photos/kevlar/1152595430 obtained under a Creative Commons (BY-NC-ND)

Preparing for partial 2 “exam”

Well, here I am… doing stuff, I want to sleep, but whatever, who needs that?

I do… I really should…

Here we go:

What are inheritance and polymorphism? (Specification and implementation)

  • Inheritance: When I think of inheritance, I think of the keyword “extends”, you know, that thing you put at the new class, when you want it to have all of the superior classes methods and attributes. That is inheritance.
  • Polymorphism: Now, this gets more complicated. It is to inherit a method from a superclass, but only to mostly have it modified in the subclass or in the same class (Overloading and overwriting).

What are overloading and overwriting? How do we implement those in Java?

  • Overriding: It is dynamic because its made between a hierarchy of classes. It implies that the method in the current class is the one being initialized (even if super classes have the same named method). The only way to get the supermethod also initialized is to write super.methodname().
    class Car { makeNoise(System.out.println(“Bruum”))}
    subclass Ferrari { makeNoise(System.out.println(“Big lousy bruum”))}
    Final output: Big lousy broom
  • Overloading: It is static because it can be done in the same class. It ocurrs when two or more methods have the same name, but different arguments (Type or quantity).

What is delegation?

  • To call another method, or even another class to do your chores (Instead of doing it by itself).

What are CRC cards and how do we use them?

  • Stands form Class Responsibility Colaboration. Used to stated how classes work. Its a design that answer to what and with whom the job will get done.

What do you feel are the benefits to object-oriented programming?

  • It provides the tools to create everything! Seriously. As always, if you consider that everything is an object, that means that, to some extent, you can create anything as long as it has characteristics and functions. If it isn’t sufficient to you, because you want still something more specific, you can overwrite and overload until you get exactly what you want.

Why do you think your change to object-oriented programming is difficult or what makes it difficult for the standard student?

  • I really like the way my dear friend Arturo explained it. I guess I would explaine it as he has done it (The analogy with math dimensions -Luzma’s 4th dimension is really hard- its nice. And also, today I saw Interstellar, so he should add the 5th dimension to his explanation).
    The most difficult for anyone I guess it is the change from simple straight code to a more complex context. In OOP there is no room for code without order. You have a class, with a constructor, several methods, and a main method if needed. Then you have the arena (As defined here) were the objects are created with the required characteristics and do the required stuff. And then you have other classes that contain other objects and you need to find a way to get everything connected without making Java explode, or yourself.

Like a dear YouTuber would say (Jake Roper Vsauce3’s host). I guess I’ll stick to this until I have a proper way to end my posts:

“But remember my dear friend: Its not good-bye, oh no, its never good-bye, its… see you later (you’re pretty darn awesome)

-Miguel

 

 

WSQGraphicsExtra

Well, now into some Graphing basics. I’ve done the MIT exercises that Ken previously had shown us. You should know, dear reader, that my art it’s just going to be as good as that bear of the Flickr artist Orin Zebest ( ;-; )

As always, my code can be found on GitHub. This time just one class, the DrawGraphics, was modified, because the objective of this activity was mainly to teach how to insert objects into the drawing surface, how do the parameters work and how to animate an object. Further I’ve revised the code of the other two classes, it is very similar to previous work I’ve done in Python or JavaScript, so nothing scary there.

Now, here it is the code:

Screenshot from 2016-04-03 23-48-24.png

And the result (OMG a gif!)

optimised.gif

You know how to get in touch, I hope…

Like a dear YouTuber would say (Jake Roper Vsauce3’s host):

“But remember my dear friend: Its not good-bye, oh no, its never good-bye, its see you later (you’re pretty darn awesome)”

2110547610_831a653a7c_b
flickr photo by orinrobertjohn https://www.flickr.com/photos/orinrobertjohn/2110547610 obtained under a Creative Commons (BY)

Coldcraft Per Diem 1

OMG… I’m doing this so late. If you want to read about the basic ideas of this mod, go to my partner’s blog. Also, I can’t recommend enough BedrockMiner’s blog/tutorial about modding minecraft.

Now, about the things that I’ve been working on. Everything can be found on GitHub.
First I’ve established the Main class, along with the Client Proxy (Where the things the clients need to initialize), the Server Proxy (Just Server), and the Common Proxy (Where the thing both need to initialize). Every time a new category of blocks, items, new classes is created we need to decide who will make the initialization.

A block, named TestBlock, -I hope this useless block can evolve to a campfire or something, I just need the textures and a crafting recipe, that I’m currently working on (just the textures)-. The first thing necessary for the creation of blocks is to create a Basic Block Class, where all the little cute blocks -like Test Block- go to get created. This is a basic template for all blocks.Screenshot from 2016-04-03 15-58-34

Then we create the object (block) in particular in the class ModBlocks. Here the object testBlock is created with the only special attribute of emitting 1 point of light, that is equivalent to daylight.

Screenshot from 2016-04-03 15-59-18

Finally we need to register the block into Forge and Minecraft, here is where the texture and icon is assigned. The characteristics of both are explicitly given on some jsons in the folder of resources. Forge know what to assign to what because the Unlocalized Name given to each block (Just 1 in this case).

Screenshot from 2016-04-03 16-00-19

BTW, the rendering is only initialized on the client side, while the block per se is needed on client and server side.

Now, things I will focus:

  • Give this block a recipe, and more attributes, like a harvesting level and tool, sound when stepped on, assign it to the correct material category, so it can have proper physics.
  • Give it a new texture, if possible a changing texture (I need to research more into that topic)
  • Try to get into the armor/robes theme.

For more information, you know where to find me… or my team (Santiago Kelley and Arturo Fornes).

Peace.

😀