-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Collapse duplicates in creative menu and JEI * Add vanilla provider for MobSpawner, prevent waila error from consuming the universe * Use TextComponentTranslation to localize spawner probedata clientside
- Loading branch information
1 parent
f1b28e3
commit 8f323a8
Showing
6 changed files
with
59 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,6 @@ private.properties | |
minecraft | ||
.idea | ||
*.iml | ||
|
||
#Extra stuff for Falk's dumb compy | ||
.directory |
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
38 changes: 38 additions & 0 deletions
38
src/main/java/com/elytradev/fruitphone/vanilla/MobSpawnerDataProvider.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,38 @@ | ||
package com.elytradev.fruitphone.vanilla; | ||
|
||
import java.util.List; | ||
|
||
import com.elytradev.probe.api.IProbeData; | ||
import com.elytradev.probe.api.impl.ProbeData; | ||
import com.google.common.collect.ImmutableList; | ||
|
||
import net.minecraft.init.Blocks; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraft.tileentity.TileEntityMobSpawner; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraft.util.text.TextComponentTranslation; | ||
import net.minecraftforge.fml.common.registry.EntityEntry; | ||
import net.minecraftforge.fml.common.registry.ForgeRegistries; | ||
|
||
public class MobSpawnerDataProvider implements VanillaDataProvider<TileEntityMobSpawner> { | ||
|
||
@Override | ||
public void provideProbeData(TileEntityMobSpawner te, List<IProbeData> li) { | ||
NBTTagCompound tag = new NBTTagCompound(); | ||
te.writeToNBT(tag); | ||
NBTTagCompound spawnData = tag.getCompoundTag("SpawnData"); | ||
if (spawnData.hasKey("id")) { | ||
String entityId = spawnData.getString("id"); | ||
EntityEntry entry = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(entityId)); | ||
|
||
TextComponentTranslation title = new TextComponentTranslation("fruitphone.mobSpawner.title", new TextComponentTranslation("entity."+entry.getName()+".name"), new TextComponentTranslation("tile.mobSpawner.name")); | ||
|
||
li.add(new ProbeData() | ||
.withInventory(ImmutableList.of(new ItemStack(Blocks.MOB_SPAWNER))) | ||
.withLabel(title)); | ||
} | ||
|
||
} | ||
|
||
} |
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