-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from gottsch/1.12.2-develop
Fixed numerous gravestone tile entity issue.
- Loading branch information
Showing
17 changed files
with
261 additions
and
209 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
57 changes: 57 additions & 0 deletions
57
src/com/someguyssoftware/treasure2/block/GravestoneSpawnerBlock.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,57 @@ | ||
/** | ||
* | ||
*/ | ||
package com.someguyssoftware.treasure2.block; | ||
|
||
import java.util.Random; | ||
|
||
import com.someguyssoftware.treasure2.tileentity.GravestoneProximitySpawnerTileEntity; | ||
|
||
import net.minecraft.block.ITileEntityProvider; | ||
import net.minecraft.block.material.Material; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.world.World; | ||
|
||
/** | ||
* | ||
* @author Mark Gottschling on Sep 14, 2020 | ||
* | ||
*/ | ||
public class GravestoneSpawnerBlock extends GravestoneBlock implements ITileEntityProvider { | ||
|
||
/** | ||
* | ||
* @param modID | ||
* @param name | ||
* @param material | ||
*/ | ||
public GravestoneSpawnerBlock(String modID, String name, Material material) { | ||
super(modID, name, material); | ||
} | ||
|
||
@Override | ||
public TileEntity createNewTileEntity(World worldIn, int meta) { | ||
GravestoneProximitySpawnerTileEntity tileEntity = new GravestoneProximitySpawnerTileEntity(); | ||
return (TileEntity) tileEntity; | ||
} | ||
|
||
|
||
/** | ||
* Drops standard gravestones. | ||
*/ | ||
@Override | ||
public Item getItemDropped(IBlockState state, Random rand, int fortune) { | ||
if (this == TreasureBlocks.GRAVESTONE1_SPAWNER_STONE) { | ||
return Item.getItemFromBlock(TreasureBlocks.GRAVESTONE1_STONE); | ||
} | ||
else if (this == TreasureBlocks.GRAVESTONE2_SPAWNER_COBBLESTONE) { | ||
return Item.getItemFromBlock(TreasureBlocks.GRAVESTONE2_COBBLESTONE); | ||
} | ||
else if (this == TreasureBlocks.GRAVESTONE3_SPAWNER_OBSIDIAN) { | ||
return Item.getItemFromBlock(TreasureBlocks.GRAVESTONE3_OBSIDIAN); | ||
} | ||
return super.getItemDropped(state, rand, fortune); | ||
} | ||
} |
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
Oops, something went wrong.