mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
-Update 0.0.6.0
This commit is contained in:
parent
fb535bb9ec
commit
7e4ca12793
9 changed files with 52 additions and 48 deletions
|
@ -12,7 +12,7 @@ What that means? I can decide what I want to do with the License myself.
|
||||||
### YOU MAY
|
### YOU MAY
|
||||||
- Fork and modify the Code
|
- Fork and modify the Code
|
||||||
- Submit Pull Requests
|
- Submit Pull Requests
|
||||||
- Copy Parts of the Code for other Projects
|
- Copy (SMALL!) Parts of the Code for other Projects
|
||||||
- Make a Review/Spotlight of the Mod or use it in a Modpack
|
- Make a Review/Spotlight of the Mod or use it in a Modpack
|
||||||
- Make Let's Play (and similar) Videos containing my Mod
|
- Make Let's Play (and similar) Videos containing my Mod
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ What that means? I can decide what I want to do with the License myself.
|
||||||
### YOU CAN NOT
|
### YOU CAN NOT
|
||||||
- Copy the entire Code or claim it is yours.
|
- Copy the entire Code or claim it is yours.
|
||||||
- Reupload the Code or Mod to another website or claim you made it.
|
- Reupload the Code or Mod to another website or claim you made it.
|
||||||
|
- Copy entire Classes, Methods or other big Parts of Code.
|
||||||
|
|
||||||
### YOU HAVE TO
|
### YOU HAVE TO
|
||||||
- Always credit me. Don't be a jerk and copy entire portions of the code and claim they're yours.
|
- Always credit me. Don't be a jerk and copy entire portions of the code and claim they're yours.
|
||||||
|
|
|
@ -109,3 +109,7 @@
|
||||||
-Dog Bones
|
-Dog Bones
|
||||||
-Breed Dogs faster
|
-Breed Dogs faster
|
||||||
-Makes them have Babies too
|
-Makes them have Babies too
|
||||||
|
|
||||||
|
-Testificate Bucks
|
||||||
|
-Village House that has a Coffee Machine
|
||||||
|
-Villager who sells Coffee and Cookies
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class BlockPlant extends BlockCrops implements INameableItem, IFactoryHar
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int quantityDropped(int meta, int fortune, Random random){
|
public int quantityDropped(int meta, int fortune, Random random){
|
||||||
return random.nextInt(addDropAmount)+minDropAmount;
|
return meta >= 7 ? super.quantityDropped(meta, fortune, random) : random.nextInt(addDropAmount)+minDropAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -219,7 +219,7 @@ public class InitBlocks{
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
errorAlreadyRegistered("Oil Fluid");
|
errorAlreadyRegistered("Oil Fluid");
|
||||||
}
|
}
|
||||||
fluidOil = FluidRegistry.getFluid(oil);
|
fluidOil = FluidRegistry.getFluid(oil);
|
||||||
|
|
||||||
if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){
|
if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){
|
||||||
|
|
|
@ -242,10 +242,10 @@ public class ItemCrafting{
|
||||||
|
|
||||||
//Crafter on a Stick
|
//Crafter on a Stick
|
||||||
if(ConfigCrafting.STICK_CRAFTER.isEnabled())
|
if(ConfigCrafting.STICK_CRAFTER.isEnabled())
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemCrafterOnAStick),
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemCrafterOnAStick),
|
||||||
new ItemStack(Blocks.crafting_table),
|
new ItemStack(Blocks.crafting_table),
|
||||||
new ItemStack(Items.sign),
|
new ItemStack(Items.sign),
|
||||||
new ItemStack(Items.slime_ball));
|
"slimeball"));
|
||||||
|
|
||||||
//Tiny Coal
|
//Tiny Coal
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.TINY_COAL.ordinal()),
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.TINY_COAL.ordinal()),
|
||||||
|
|
|
@ -88,13 +88,11 @@ public class ContainerEnergizer extends Container{
|
||||||
if(slot <= hotbarEnd && slot >= hotbarStart){
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(slot < inventoryStart){
|
else if(slot < inventoryStart){
|
||||||
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newStack.stackSize == 0) theSlot.putStack(null);
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
|
|
@ -70,24 +70,22 @@ public class ItemDrill extends ItemEnergyContainer implements INameableItem{
|
||||||
ItemStack upgrade = this.getHasUpgradeAsStack(stack, ItemDrillUpgrade.UpgradeType.PLACER);
|
ItemStack upgrade = this.getHasUpgradeAsStack(stack, ItemDrillUpgrade.UpgradeType.PLACER);
|
||||||
if(upgrade != null){
|
if(upgrade != null){
|
||||||
int slot = ItemDrillUpgrade.getSlotToPlaceFrom(upgrade);
|
int slot = ItemDrillUpgrade.getSlotToPlaceFrom(upgrade);
|
||||||
if(slot >= 0 && slot < InventoryPlayer.getHotbarSize() && slot != player.inventory.currentItem){
|
if(slot >= 0 && slot < InventoryPlayer.getHotbarSize()){
|
||||||
ItemStack equip = player.inventory.getStackInSlot(slot);
|
ItemStack anEquip =player.inventory.getStackInSlot(slot);
|
||||||
if(equip != null){
|
if(anEquip != null && anEquip != stack){
|
||||||
|
ItemStack equip = anEquip.copy();
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
boolean placed = false;
|
|
||||||
try{
|
try{
|
||||||
placed = equip.tryPlaceItemIntoWorld(player, world, x, y, z, hitSide, hitX, hitY, hitZ);
|
if(equip.tryPlaceItemIntoWorld(player, world, x, y, z, hitSide, hitX, hitY, hitZ)){
|
||||||
|
if(!player.capabilities.isCreativeMode) player.inventory.setInventorySlotContents(slot, equip.stackSize <= 0 ? null : equip.copy());
|
||||||
|
player.inventoryContainer.detectAndSendChanges();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e){
|
catch(Exception e){
|
||||||
player.addChatComponentMessage(new ChatComponentText("Ouch! That really hurt! You must have done something wrong, don't do that again please!"));
|
player.addChatComponentMessage(new ChatComponentText("Ouch! That really hurt! You must have done something wrong, don't do that again please!"));
|
||||||
ModUtil.LOGGER.log(Level.ERROR, "Player "+player.getDisplayName()+" who should place a Block using a Drill at "+player.posX+", "+player.posY+", "+player.posZ+" in World "+world.provider.dimensionId+" threw an Exception! Don't let that happen again!");
|
ModUtil.LOGGER.log(Level.ERROR, "Player "+player.getDisplayName()+" who should place a Block using a Drill at "+player.posX+", "+player.posY+", "+player.posZ+" in World "+world.provider.dimensionId+" threw an Exception! Don't let that happen again!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(placed){
|
|
||||||
player.inventory.setInventorySlotContents(slot, equip.stackSize <= 0 ? null : equip.copy());
|
|
||||||
player.inventoryContainer.detectAndSendChanges();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else return true;
|
else return true;
|
||||||
}
|
}
|
||||||
|
@ -320,7 +318,7 @@ public class ItemDrill extends ItemEnergyContainer implements INameableItem{
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
if(!living.isSneaking() && this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){
|
if(!living.isSneaking() && this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){
|
||||||
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)){
|
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)){
|
||||||
this.breakBlocks(stack, 2, world, x, y, z, player);
|
this.breakBlocks(stack, 30, world, x, y, z, player);
|
||||||
}
|
}
|
||||||
else this.breakBlocks(stack, 1, world, x, y, z, player);
|
else this.breakBlocks(stack, 1, world, x, y, z, player);
|
||||||
}
|
}
|
||||||
|
@ -354,7 +352,7 @@ public class ItemDrill extends ItemEnergyContainer implements INameableItem{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){
|
||||||
if(!world.isRemote && player.isSneaking()){
|
if(!world.isRemote && player.isSneaking() && stack == player.getCurrentEquippedItem()){
|
||||||
player.openGui(ActuallyAdditions.instance, GuiHandler.DRILL_ID, world, (int)player.posX, (int)player.posY, (int)player.posZ);
|
player.openGui(ActuallyAdditions.instance, GuiHandler.DRILL_ID, world, (int)player.posX, (int)player.posY, (int)player.posZ);
|
||||||
}
|
}
|
||||||
return stack;
|
return stack;
|
||||||
|
|
|
@ -19,16 +19,18 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
if(this.slots[0] != null && this.slots[0].getItem() instanceof IEnergyContainerItem && this.slots[1] == null){
|
if(!worldObj.isRemote){
|
||||||
if(this.storage.getEnergyStored() > 0){
|
if(this.slots[0] != null && this.slots[0].getItem() instanceof IEnergyContainerItem && this.slots[1] == null){
|
||||||
int received = ((IEnergyContainerItem)this.slots[0].getItem()).receiveEnergy(this.slots[0], this.storage.getEnergyStored(), false);
|
if(this.storage.getEnergyStored() > 0){
|
||||||
this.storage.extractEnergy(received, false);
|
int received = ((IEnergyContainerItem)this.slots[0].getItem()).receiveEnergy(this.slots[0], this.storage.getEnergyStored(), false);
|
||||||
}
|
this.storage.extractEnergy(received, false);
|
||||||
|
}
|
||||||
|
|
||||||
if(((IEnergyContainerItem)this.slots[0].getItem()).getEnergyStored(this.slots[0]) >= ((IEnergyContainerItem)this.slots[0].getItem()).getMaxEnergyStored(this.slots[0])){
|
if(((IEnergyContainerItem)this.slots[0].getItem()).getEnergyStored(this.slots[0]) >= ((IEnergyContainerItem)this.slots[0].getItem()).getMaxEnergyStored(this.slots[0])){
|
||||||
this.slots[1] = this.slots[0].copy();
|
this.slots[1] = this.slots[0].copy();
|
||||||
this.slots[0].stackSize--;
|
this.slots[0].stackSize--;
|
||||||
if(this.slots[0].stackSize <= 0) this.slots[0] = null;
|
if(this.slots[0].stackSize <= 0) this.slots[0] = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,27 +20,29 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
if(this.slots[0] != null && this.slots[0].getItem() instanceof IEnergyContainerItem && this.slots[1] == null){
|
if(!worldObj.isRemote){
|
||||||
if(((IEnergyContainerItem)this.slots[0].getItem()).getEnergyStored(this.slots[0]) > 0){
|
if(this.slots[0] != null && this.slots[0].getItem() instanceof IEnergyContainerItem && this.slots[1] == null){
|
||||||
int toReceive = ((IEnergyContainerItem)this.slots[0].getItem()).extractEnergy(this.slots[0], this.storage.getMaxEnergyStored()-this.storage.getEnergyStored(), false);
|
if(((IEnergyContainerItem)this.slots[0].getItem()).getEnergyStored(this.slots[0]) > 0){
|
||||||
this.storage.receiveEnergy(toReceive, false);
|
int toReceive = ((IEnergyContainerItem)this.slots[0].getItem()).extractEnergy(this.slots[0], this.storage.getMaxEnergyStored()-this.storage.getEnergyStored(), false);
|
||||||
|
this.storage.receiveEnergy(toReceive, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(((IEnergyContainerItem)this.slots[0].getItem()).getEnergyStored(this.slots[0]) <= 0){
|
||||||
|
this.slots[1] = this.slots[0].copy();
|
||||||
|
this.slots[0].stackSize--;
|
||||||
|
if(this.slots[0].stackSize <= 0) this.slots[0] = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(((IEnergyContainerItem)this.slots[0].getItem()).getEnergyStored(this.slots[0]) <= 0){
|
if(this.getEnergyStored(ForgeDirection.UNKNOWN) > 0){
|
||||||
this.slots[1] = this.slots[0].copy();
|
WorldUtil.pushEnergy(worldObj, xCoord, yCoord, zCoord, ForgeDirection.UP, storage);
|
||||||
this.slots[0].stackSize--;
|
WorldUtil.pushEnergy(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, storage);
|
||||||
if(this.slots[0].stackSize <= 0) this.slots[0] = null;
|
WorldUtil.pushEnergy(worldObj, xCoord, yCoord, zCoord, ForgeDirection.NORTH, storage);
|
||||||
|
WorldUtil.pushEnergy(worldObj, xCoord, yCoord, zCoord, ForgeDirection.EAST, storage);
|
||||||
|
WorldUtil.pushEnergy(worldObj, xCoord, yCoord, zCoord, ForgeDirection.SOUTH, storage);
|
||||||
|
WorldUtil.pushEnergy(worldObj, xCoord, yCoord, zCoord, ForgeDirection.WEST, storage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.getEnergyStored(ForgeDirection.UNKNOWN) > 0){
|
|
||||||
WorldUtil.pushEnergy(worldObj, xCoord, yCoord, zCoord, ForgeDirection.UP, storage);
|
|
||||||
WorldUtil.pushEnergy(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, storage);
|
|
||||||
WorldUtil.pushEnergy(worldObj, xCoord, yCoord, zCoord, ForgeDirection.NORTH, storage);
|
|
||||||
WorldUtil.pushEnergy(worldObj, xCoord, yCoord, zCoord, ForgeDirection.EAST, storage);
|
|
||||||
WorldUtil.pushEnergy(worldObj, xCoord, yCoord, zCoord, ForgeDirection.SOUTH, storage);
|
|
||||||
WorldUtil.pushEnergy(worldObj, xCoord, yCoord, zCoord, ForgeDirection.WEST, storage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue