mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Lets just simply this. Fixes last commit.
This commit is contained in:
1 parent
d5b93bf262
commit
87b0f7db99
1 file changed
+3
-8
@@ -228,7 +228,6 @@ public class VillagerRegistry
|
||||
private String name;
|
||||
private int id;
|
||||
private List<List<ITradeList>> trades = Lists.newArrayList();
|
||||
private List<List<ITradeList>> imm = Lists.newArrayList();
|
||||
|
||||
public VillagerCareer(VillagerProfession parent, String name)
|
||||
{
|
||||
@@ -251,20 +250,16 @@ public class VillagerRegistry
|
||||
List<ITradeList> levelTrades = level <= this.trades.size() ? this.trades.get(level - 1) : null;
|
||||
if (levelTrades == null)
|
||||
{
|
||||
List<ITradeList> tmp = null;
|
||||
while (this.trades.size() < level)
|
||||
{
|
||||
tmp = Lists.newArrayList();
|
||||
this.trades.add(tmp);
|
||||
this.imm.add(Collections.unmodifiableList(tmp));
|
||||
levelTrades = Lists.newArrayList();
|
||||
this.trades.add(levelTrades);
|
||||
}
|
||||
levelTrades = tmp;
|
||||
}
|
||||
if (levelTrades == null) //Not sure how this could happen, but screw it
|
||||
{
|
||||
levelTrades = Lists.newArrayList();
|
||||
this.trades.set(level - 1, levelTrades);
|
||||
this.imm.set(level - 1, Collections.unmodifiableList(levelTrades));
|
||||
}
|
||||
for (ITradeList t : trades)
|
||||
levelTrades.add(t);
|
||||
@@ -274,7 +269,7 @@ public class VillagerRegistry
|
||||
|
||||
public List<ITradeList> getTrades(int level)
|
||||
{
|
||||
return level >= 0 && level < this.imm.size() ? this.imm.get(level) : null;
|
||||
return level >= 0 && level < this.trades.size() ? Collections.unmodifiableList(this.trades.get(level)) : null;
|
||||
}
|
||||
private VillagerCareer init(EntityVillager.ITradeList[][] trades)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user