-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
10 changed files
with
214 additions
and
2 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,64 @@ | ||
package huige233.transcend.items; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.item.EntityItem; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.DamageSource; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.event.entity.item.ItemExpireEvent; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public class fireimmune extends EntityItem { | ||
public fireimmune(World world, Entity location, ItemStack stack) { | ||
this(world, location.posX, location.posY, location.posZ, stack); | ||
this.setPickupDelay(20); | ||
this.motionX = location.motionX; | ||
this.motionY = location.motionY; | ||
this.motionZ = location.motionZ; | ||
this.setItem(stack); | ||
} | ||
public fireimmune(World world, double x, double y, double z, ItemStack itemstack) { | ||
super(world, x, y, z, itemstack); | ||
this.setItem(itemstack); | ||
} | ||
|
||
public fireimmune(World world, double x, double y, double z) { | ||
super(world, x, y, z); | ||
this.isImmuneToFire = true; | ||
} | ||
|
||
public fireimmune(World world) { | ||
super(world); | ||
isImmuneToFire = true; | ||
} | ||
|
||
|
||
protected void dealFireDamage(int damage) { | ||
} | ||
|
||
@Override | ||
public boolean attackEntityFrom(@Nonnull DamageSource source, float amount) { | ||
if (source.getDamageType().equals(DamageSource.OUT_OF_WORLD.damageType)) { | ||
return true; | ||
} | ||
// prevent any damage besides out of world | ||
return false; | ||
} | ||
|
||
public static class EventHandler { | ||
|
||
public static final EventHandler instance = new EventHandler(); | ||
|
||
private EventHandler() { | ||
} | ||
|
||
@SubscribeEvent | ||
public void onExpire(ItemExpireEvent event) { | ||
if (event.getEntityItem() instanceof fireimmune) { | ||
event.setCanceled(true); | ||
} | ||
} | ||
} | ||
} |
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
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
Binary file added
BIN
+546 Bytes
src/main/resources/assets/transcend/textures/items/transcend_pickaxe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.