-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed trades, moved totem code, fixed mauler inf exp bug
- Loading branch information
Showing
8 changed files
with
258 additions
and
292 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
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
35 changes: 35 additions & 0 deletions
35
common/src/main/java/com/faboslav/friendsandfoes/common/util/BasicTradeOffer.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,35 @@ | ||
package com.faboslav.friendsandfoes.common.util; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.math.random.Random; | ||
import net.minecraft.village.TradeOffer; | ||
import net.minecraft.village.TradeOffers; | ||
|
||
public class BasicTradeOffer implements TradeOffers.Factory { | ||
private final Item itemToTrade; | ||
private final Item itemToReceive; | ||
private final int amountToGive; | ||
private final int amountToReceive; | ||
protected final int maxUses; | ||
protected final int experience; | ||
protected final float multiplier; | ||
|
||
public BasicTradeOffer(Item itemToTrade, Item itemToReceive, int amountToGive, int amountToReceive, int maxUses, int experience, float multiplier) { | ||
this.itemToTrade = itemToTrade; | ||
this.itemToReceive = itemToReceive; | ||
this.amountToGive = amountToGive; | ||
this.amountToReceive = amountToReceive; | ||
this.maxUses = maxUses; | ||
this.experience = experience; | ||
this.multiplier = multiplier; | ||
} | ||
|
||
@Override | ||
public TradeOffer create(Entity entity, Random random) { | ||
ItemStack in = new ItemStack(this.itemToTrade, this.amountToGive); | ||
ItemStack out = new ItemStack(this.itemToReceive, this.amountToReceive); | ||
return new TradeOffer(in, out, this.maxUses, this.experience, this.multiplier); | ||
} | ||
} |
Oops, something went wrong.