TEALS Minecraft Project

Slides:



Advertisements
Similar presentations
Inserting a Node into a Specified Position of a Linked List To create a node for the new item newNode = new Node(item); To insert a node between two nodes.
Advertisements

COSC 1P03 Data Structures and Abstraction 9.1 The Queue Whenever you are asked if you can do a job, tell 'em, "Certainly, I can!" Then get busy and find.
Sitefinity 4.0 Fluent API.
Introduction to Stacks What is a Stack Stack implementation using arrays. Application of Stack.
Introduction to Stacks What are Stacks? Stack implementation using arrays. Stack application.
Stacks Cmput Lecture 18 Department of Computing Science University of Alberta ©Duane Szafron 2000 Some code in this lecture is based on code from.
Introduction to Stacks What is a Stack Stack implementation using array. Stack implementation using linked list. Applications of Stack.
30-Jun-15 Stacks. What is a stack? A stack is a Last In, First Out (LIFO) data structure Anything added to the stack goes on the “top” of the stack Anything.
PROG Mobile Java Application Development PROG Mobile Java Application Development Event Handling Creating Menus.
3.1 Documentation & Java Language Elements Purpose of documentation Assist the programmer with developing the program Assist other programers who.
Inheritance using Java
Problem of the Day  What is the smallest positive integer that cannot be defined in less than twenty-five syllables?
Copyright © 2015 – Curt Hill Minecraft Blocks Properties and Methods.
Data Structures. The Stack: Definition A stack is an ordered collection of items into which new items may be inserted and from which items may be deleted.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
Debugging Dwight Deugo Nesa Matic
Debugging. 2 © 2003, Espirity Inc. Module Road Map 1.Eclipse Debugging  Debug Perspective  Debug Session  Breakpoint  Debug Views  Breakpoint Types.
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
University of Sunderland COM 220 Lecture Six Slide 1 Building Interactive Forms Applications using Oracle.
1 Stacks and Queues Based on D.S. Malik, Java Programming: Program Design Including Data Structures.
Java Classes Chapter 1. 2 Chapter Contents Objects and Classes Using Methods in a Java Class References and Aliases Arguments and Parameters Defining.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
1 CSC/ECE 517 Fall 2010 Lec. 3 Overview of Eclipse Lectures Lecture 2 “Lecture 0” Lecture 3 1.Overview 2.Installing and Running 3.Building and Running.
Lecture Objectives  To understand how Java implements a stack  To learn how to implement a stack using an underlying array or linked list  Implement.
1 Alma Migration Form How to fill in the Non-Ex Libris Migration Form.
Lecture 8: Advanced OOP Part 2. Overview Review of Subtypes Interfaces Packages Sorting.
Lecture 3: Blocks 1 TEALS MINECRAFT PROJECT. MINECRAFT BLOCKS Blocks form the terrain & buildings in the Minecraft world. Blocks can change appearance,
CSE 501N Fall ‘09 10: Introduction to Collections and Linked Lists 29 September 2009 Nick Leidenfrost.
TEALS MINECRAFT PROJECT Lecture 1: Intro to Minecraft Forge.
Integrating Components and Dynamic Text Boxes with the Animated Map– Lesson 101 Integrating Components and Dynamic Text Boxes with the Animated Map Lesson.
Lecture 6: Basic Entities TEALS MINECRAFT PROJECT.
Click to edit Master text styles Stacks Data Structure.
Programming in Java Transitioning from Alice. Becomes not myFirstMethod but …. public static void main (String[] arg) { // code for testing classes goes.
Section 3.7 Linked-Based Implementations
CSC 205 Programming II Lecture 5 AWT - I.
Microsoft Office Access 2010 Lab 1
Java FX: Scene Builder.
Modern Programming Tools And Techniques-I
Sections 3.4 Formal Specification
Stack: a Linked Implementation
Stacks II David Lillis School of Computer Science and Informatics
Module Road Map Refactoring Why Refactoring? Examples
2.7 Inheritance Types of inheritance
Types of Inventories Raw materials & purchased parts.
Refactoring Methods: Kevin Murphy.
Chapter 3: Using Methods, Classes, and Objects
Inheritance AKEEL AHMED.
Important terms Black-box testing White-box testing Regression testing
COMPUTER 2430 Object Oriented Programming and Data Structures I
CS Week 14 Jim Williams, PhD.
Important terms Black-box testing White-box testing Regression testing
Lecture 9 Concepts of Programming Languages
Lecture 5 – Improved Monte Carlo methods in finance: lab
Overview of Eclipse Lectures
Lecture 22 Inheritance Richard Gesick.
Lecture 5 Stacks King Fahd University of Petroleum & Minerals
Implementing Non-Static Features
Interfaces.
TEALS Minecraft Project
Aleph Circulation Loans & Returns Version 19
Recitation 7 October 7, 2011.
TEALS Minecraft Project
Debugging Dwight Deugo
CIS 199 Final Review.
TEALS Minecraft Project
Stacks.
Finding Your GP Data Ian Richardson BA CPA CGA Colin Pich CPA CGA.
Lecture 9 Concepts of Programming Languages
CHAPTER 3: Collections—Stacks
Presentation transcript:

TEALS Minecraft Project Lecture 2: Modding Minecraft Items

What’s a Minecraft Item? Items are things like plants, tools, eggs and other objects that can be found in the world.

Minecraft Item Objects All items extend the Minecraft Item class. There are multiple base classes that extend the Item class: ItemArmor: items that the player can wear ItemFood: items that the player can eat ItemTool: items that the player can use to modify the world Items have the following properties: A maximum stack size → the number of items that can combine in one slot of your inventory. A creative tab → the location in the creative inventory of the item.

Item Stacks A player’s inventory has 36 slots. The “hot bar” has nine slots (1–9). Each slot holds an “item stack”. A stack of items is just a certain number of items of a single type. For example, an item stack of five calculators, or an item stack of 64 sand blocks. An inventory slot can be empty (null in the code). The item count is stored in the ItemStack stackSize field. The inventory pop-up has multiple tabs. These are called “creative tabs”. Each tab holds blocks and items of a certain category.

Creating Custom Items To create a custom item, you need to Extend the Item class, Add code in the Item constructor to set the maximum stack size with setMaxStackSize(), and set the desired creative tab with setCreativeTab(). Register the item in your ItemsModule onLoad() method.

Example Item Code Item Class package tealsmc.mods; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class AntiBurnItem extends Item { public AntiBurnItem() { // Set up item defaults. setMaxStackSize(16); setCreativeTab(CreativeTabs.tabDecorations); } @Override public boolean onDroppedByPlayer (ItemStack item, EntityPlayer player) { // If the player is on fire, stop them from burning. if (player.isBurning()) player.extinguish(); return super.onDroppedByPlayer (item, player); Note that the onDroppedByPlayer() function is unimportant – this is only to show the general flow of extending a block.

Example Item Code Module Class package tealsmc.mods; import org.tealsk12.tealsmodloader.module.Module; public class ItemsModule extends Module { public void onLoad() { // Create Item Instances AntiBurnItem antiBurn = new AntiBurnItem(); // Register Instances parentMod.itemRegistry.newInstance( "anti_burn_item", antiBurn, "Anti Burn Item"); }

Item Lab For the item lab, we will implement a new Minecraft item: a rock sifter. The rock sifter item will find all sand blocks in your inventory, and for each one will have a 10% chance of finding a gold nugget. When the sifter is finished, sand blocks in your inventory will be replaced with a random amount of gold nugget items.