generated from Turnip-Labs/bta-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16f7429
commit 3c51a3f
Showing
9 changed files
with
119 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package turniplabs.examplemod; | ||
|
||
import net.minecraft.client.render.item.model.ItemModelStandard; | ||
import net.minecraft.core.item.Item; | ||
import net.minecraft.core.item.ItemStack; | ||
|
||
import java.awt.*; | ||
|
||
public class CustomItemModel extends ItemModelStandard { | ||
public CustomItemModel(Item item, String namespace) { | ||
super(item, namespace); | ||
} | ||
@Override | ||
public int getColor(ItemStack stack) { | ||
// Slowly shift its color as time increases | ||
return Color.HSBtoRGB((System.currentTimeMillis()%10000)/10000f, 1f, 1f); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/turniplabs/examplemod/item/ItemCarrotStick.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package turniplabs.examplemod.item; | ||
|
||
import net.minecraft.core.entity.Entity; | ||
import net.minecraft.core.entity.animal.EntityPig; | ||
import net.minecraft.core.entity.player.EntityPlayer; | ||
import net.minecraft.core.item.Item; | ||
import net.minecraft.core.item.ItemStack; | ||
import net.minecraft.core.util.phys.Vec3d; | ||
import net.minecraft.core.world.World; | ||
|
||
public class ItemCarrotStick extends Item { | ||
public ItemCarrotStick(String name, int id) { | ||
super(name, id); | ||
} | ||
@Override | ||
public void inventoryTick(ItemStack itemstack, World world, Entity entity, int i, boolean flag) { | ||
if (!(entity instanceof EntityPlayer)) return; | ||
if (((EntityPlayer) entity).getHeldItem() == null) return; | ||
if (((EntityPlayer) entity).getHeldItem().getItem() != this) return; | ||
if (!(entity.vehicle instanceof EntityPig)) return; | ||
EntityPig pig = (EntityPig) entity.vehicle; | ||
Vec3d looking = entity.getLookAngle(); | ||
int x = (int) (entity.x + looking.xCoord * 5); | ||
int y = (int) (entity.y + looking.yCoord * 5); | ||
int z = (int) (entity.z + looking.zCoord * 5); | ||
pig.setPathToEntity(world.getEntityPathToXYZ(pig, x, y, z, 20)); | ||
pig.yRot = entity.yRot; | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+201 Bytes
src/main/resources/assets/examplemod/textures/item/leather_chestplate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
item.examplemod.bamboo.name=Bamboo | ||
item.examplemod.bamboo.desc=Its bamboo, half stick half green. | ||
item.examplemod.potato.name=Potato | ||
item.examplemod.potato.desc=Edible... but just barely. | ||
item.examplemod.carrot.name=Carrot | ||
item.examplemod.carrot.desc=Orange. | ||
item.examplemod.baked.potato.name=Baked Potato | ||
item.examplemod.baked.potato.desc=Ball of heated starch. | ||
item.examplemod.stick.carrot.name=Carrot on a Stick | ||
item.examplemod.stick.carrot.desc=Pigs may be interested in this. | ||
item.examplemod.rgb.chest.name=RGB Chestplate | ||
item.examplemod.rgb.chest.desc=Made by gamers for gamers |