forked from MrJohz/InfiniTiC
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added OreBlock to show in the Smeltery Added Bow properties Added Temperature Managed to Add Buckets!!
- Loading branch information
Lak Moore
authored and
Lak Moore
committed
Jul 22, 2016
1 parent
6c7e3fa
commit 62f7573
Showing
9 changed files
with
188 additions
and
13 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package me.johz.infinitic.items; | ||
|
||
import java.awt.Color; | ||
|
||
import cpw.mods.fml.relauncher.Side; | ||
import cpw.mods.fml.relauncher.SideOnly; | ||
import me.johz.inifinitic.InfiniTiC; | ||
import me.johz.inifinitic.client.textures.CustomTexture; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.client.renderer.texture.IIconRegister; | ||
import net.minecraft.client.renderer.texture.TextureAtlasSprite; | ||
import net.minecraft.client.renderer.texture.TextureMap; | ||
import net.minecraft.init.Items; | ||
import net.minecraft.item.ItemBucket; | ||
|
||
public class InfiniBucket extends ItemBucket { | ||
private String _name; | ||
private Color _color; | ||
|
||
public InfiniBucket(Block contents, String name, Color color) { | ||
super(contents); | ||
|
||
_name = name; | ||
_color = color; | ||
|
||
this.setUnlocalizedName("infinitic.bucket." + _name); | ||
this.setContainerItem(Items.bucket); | ||
} | ||
|
||
@Override | ||
@SideOnly(Side.CLIENT) | ||
public void registerIcons (IIconRegister iconRegister) | ||
{ | ||
TextureAtlasSprite fill = new CustomTexture(_color, InfiniTiC.MODID + ":bucket_fill", true); | ||
|
||
((TextureMap)iconRegister).setTextureEntry(InfiniTiC.MODID + ":bucket_fill", fill); | ||
|
||
this.setTextureName(InfiniTiC.MODID + ":bucket_fill"); | ||
super.registerIcons(iconRegister); | ||
} | ||
|
||
} |
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,46 @@ | ||
package me.johz.inifinitic; | ||
|
||
import cpw.mods.fml.common.eventhandler.SubscribeEvent; | ||
import cpw.mods.fml.common.eventhandler.Event.Result; | ||
import mantle.world.WorldHelper; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.init.Items; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.MovingObjectPosition.MovingObjectType; | ||
import net.minecraftforge.event.entity.player.FillBucketEvent; | ||
|
||
public class InfiniEvents { | ||
|
||
@SubscribeEvent | ||
public void bucketFill (FillBucketEvent evt) | ||
{ | ||
if (evt.current.getItem() == Items.bucket && evt.target.typeOfHit == MovingObjectType.BLOCK) | ||
{ | ||
int hitX = evt.target.blockX; | ||
int hitY = evt.target.blockY; | ||
int hitZ = evt.target.blockZ; | ||
|
||
if (evt.entityPlayer != null && !evt.entityPlayer.canPlayerEdit(hitX, hitY, hitZ, evt.target.sideHit, evt.current)) | ||
{ | ||
return; | ||
} | ||
|
||
Block target = evt.world.getBlock(hitX, hitY, hitZ); | ||
for (int id = 0; id < InfiniTiC.MATERIALS.length; id++) | ||
{ | ||
if (target == InfiniTiC.MATERIALS[id].fluidBlock) | ||
{ | ||
WorldHelper.setBlockToAir(evt.world, hitX, hitY, hitZ); | ||
if (!evt.entityPlayer.capabilities.isCreativeMode) | ||
{ | ||
evt.result = new ItemStack(InfiniTiC.MATERIALS[id].fluidBucket, 1); | ||
evt.setResult(Result.ALLOW); | ||
return; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
} |
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
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