feat: remove experience
This commit is contained in:
1 parent
bdfe5350cd
commit
41d166afed
83 files changed
+47
-1501
No files matched your search
@@ -499,10 +499,6 @@ void ClientConnection::handleAddEntity(shared_ptr<AddEntityPacket> packet)
|
||||
e = shared_ptr<Entity>( new ThrownPotion(level, x, y, z, packet->data) );
|
||||
packet->data = 0;
|
||||
break;
|
||||
case AddEntityPacket::THROWN_EXPBOTTLE:
|
||||
e = shared_ptr<Entity>( new ThrownExpBottle(level, x, y, z) );
|
||||
packet->data = 0;
|
||||
break;
|
||||
case AddEntityPacket::BOAT:
|
||||
e = shared_ptr<Entity>( new Boat(level, x, y, z) );
|
||||
break;
|
||||
@@ -665,18 +661,6 @@ void ClientConnection::handleAddEntity(shared_ptr<AddEntityPacket> packet)
|
||||
|
||||
}
|
||||
|
||||
void ClientConnection::handleAddExperienceOrb(shared_ptr<AddExperienceOrbPacket> packet)
|
||||
{
|
||||
shared_ptr<Entity> e = shared_ptr<ExperienceOrb>( new ExperienceOrb(level, packet->x / 32.0, packet->y / 32.0, packet->z / 32.0, packet->value) );
|
||||
e->xp = packet->x;
|
||||
e->yp = packet->y;
|
||||
e->zp = packet->z;
|
||||
e->yRot = 0;
|
||||
e->xRot = 0;
|
||||
e->entityId = packet->id;
|
||||
level->putEntity(packet->id, e);
|
||||
}
|
||||
|
||||
void ClientConnection::handleAddGlobalEntity(shared_ptr<AddGlobalEntityPacket> packet)
|
||||
{
|
||||
double x = packet->x / 32.0;
|
||||
@@ -1234,18 +1218,7 @@ void ClientConnection::handleTakeItemEntity(shared_ptr<TakeItemEntityPacket> pac
|
||||
|
||||
if( minecraft->localgameModes[playerPad] != NULL )
|
||||
{
|
||||
// 4J-PB - add in the XP orb sound
|
||||
if(from->GetType() == eTYPE_EXPERIENCEORB)
|
||||
{
|
||||
float fPitch=((random->nextFloat() - random->nextFloat()) * 0.7f + 1.0f) * 2.0f;
|
||||
app.DebugPrintf("XP Orb with pitch %f\n",fPitch);
|
||||
level->playSound(from, eSoundType_RANDOM_ORB, 0.2f, fPitch);
|
||||
}
|
||||
else
|
||||
{
|
||||
level->playSound(from, eSoundType_RANDOM_POP, 0.2f, ((random->nextFloat() - random->nextFloat()) * 0.7f + 1.0f) * 2.0f);
|
||||
}
|
||||
|
||||
level->playSound(from, eSoundType_RANDOM_POP, 0.2f, ((random->nextFloat() - random->nextFloat()) * 0.7f + 1.0f) * 2.0f);
|
||||
minecraft->particleEngine->add( shared_ptr<TakeAnimationParticle>( new TakeAnimationParticle(minecraft->level, from, to, -0.5f) ) );
|
||||
level->removeEntity(packet->itemId);
|
||||
}
|
||||
@@ -2212,11 +2185,6 @@ void ClientConnection::handleSetHealth(shared_ptr<SetHealthPacket> packet)
|
||||
}
|
||||
}
|
||||
|
||||
void ClientConnection::handleSetExperience(shared_ptr<SetExperiencePacket> packet)
|
||||
{
|
||||
minecraft->localplayers[m_userIndex]->setExperienceValues(packet->experienceProgress, packet->totalExperience, packet->experienceLevel);
|
||||
}
|
||||
|
||||
void ClientConnection::handleTexture(shared_ptr<TexturePacket> packet)
|
||||
{
|
||||
// Both PlayerConnection and ClientConnection should handle this mostly the same way
|
||||
|
||||
@@ -51,7 +51,6 @@ public:
|
||||
INetworkPlayer *getNetworkPlayer();
|
||||
virtual void handleLogin(shared_ptr<LoginPacket> packet);
|
||||
virtual void handleAddEntity(shared_ptr<AddEntityPacket> packet);
|
||||
virtual void handleAddExperienceOrb(shared_ptr<AddExperienceOrbPacket> packet);
|
||||
virtual void handleAddGlobalEntity(shared_ptr<AddGlobalEntityPacket> packet);
|
||||
virtual void handleAddPainting(shared_ptr<AddPaintingPacket> packet);
|
||||
virtual void handleSetEntityMotion(shared_ptr<SetEntityMotionPacket> packet);
|
||||
@@ -93,7 +92,6 @@ private:
|
||||
wstring GetDisplayNameByGamertag(wstring gamertag);
|
||||
public:
|
||||
virtual void handleSetHealth(shared_ptr<SetHealthPacket> packet);
|
||||
virtual void handleSetExperience(shared_ptr<SetExperiencePacket> packet);
|
||||
virtual void handleRespawn(shared_ptr<RespawnPacket> packet);
|
||||
virtual void handleExplosion(shared_ptr<ExplodePacket> packet);
|
||||
virtual void handleContainerOpen(shared_ptr<ContainerOpenPacket> packet);
|
||||
|
||||
@@ -423,7 +423,6 @@ void IUIScene_CreativeMenu::staticCtor()
|
||||
|
||||
// Brewing (TODO)
|
||||
DEF(eCreativeInventory_Brewing)
|
||||
ITEM(Item::expBottle_Id)
|
||||
|
||||
// 4J Stu - Anything else added here also needs to be added to the key handler below
|
||||
ITEM(Item::ghastTear_Id)
|
||||
|
||||
@@ -84,40 +84,6 @@ void UIControl_EnchantmentButton::render(IggyCustomDrawCallbackRegion *region)
|
||||
//}
|
||||
|
||||
glColor4f(1, 1, 1, 1);
|
||||
if (cost != 0)
|
||||
{
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glAlphaFunc(GL_GREATER, 0.1f);
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
wstring line = _toString<int>(cost);
|
||||
Font *font = pMinecraft->altFont;
|
||||
//int col = 0x685E4A;
|
||||
unsigned int col = m_textColour;
|
||||
if (pMinecraft->localplayers[enchantingScene->getPad()]->experienceLevel < cost && !pMinecraft->localplayers[enchantingScene->getPad()]->abilities.instabuild)
|
||||
{
|
||||
col = m_textDisabledColour;
|
||||
font->drawWordWrap(m_enchantmentString, 0, 0, (float)m_width/ss, col, (float)m_height/ss);
|
||||
font = pMinecraft->font;
|
||||
//col = (0x80ff20 & 0xfefefe) >> 1;
|
||||
//font->drawShadow(line, (bwidth - font->width(line))/ss, 7, col);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_bHasFocus)
|
||||
{
|
||||
//col = 0xffff80;
|
||||
col = m_textFocusColour;
|
||||
}
|
||||
font->drawWordWrap(m_enchantmentString, 0, 0, (float)m_width/ss, col, (float)m_height/ss);
|
||||
font = pMinecraft->font;
|
||||
//col = 0x80ff20;
|
||||
//font->drawShadow(line, (bwidth - font->width(line))/ss, 7, col);
|
||||
}
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
//Lighting::turnOff();
|
||||
glDisable(GL_RESCALE_NORMAL);
|
||||
@@ -133,23 +99,6 @@ void UIControl_EnchantmentButton::updateState()
|
||||
int cost = menu->costs[m_index];
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
if(cost > pMinecraft->localplayers[enchantingScene->getPad()]->experienceLevel && !pMinecraft->localplayers[enchantingScene->getPad()]->abilities.instabuild)
|
||||
{
|
||||
// Dark background
|
||||
state = eState_Inactive;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Light background and focus background
|
||||
if(m_bHasFocus)
|
||||
{
|
||||
state = eState_Selected;
|
||||
}
|
||||
else
|
||||
{
|
||||
state = eState_Active;
|
||||
}
|
||||
}
|
||||
|
||||
if(cost != m_lastCost)
|
||||
{
|
||||
|
||||
@@ -851,29 +851,6 @@ void UIScene_HUD::handleGameTick()
|
||||
#endif
|
||||
SetActiveSlot(pMinecraft->localplayers[m_iPad]->inventory->selected);
|
||||
|
||||
// Update xp progress
|
||||
if (pMinecraft->localgameModes[m_iPad]->canHurtPlayer())
|
||||
{
|
||||
ShowExpBar(true);
|
||||
int xpNeededForNextLevel = pMinecraft->localplayers[m_iPad]->getXpNeededForNextLevel();
|
||||
int progress = (int)(pMinecraft->localplayers[m_iPad]->experienceProgress *xpNeededForNextLevel);
|
||||
SetExpBarProgress((float)progress/xpNeededForNextLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowExpBar(false);
|
||||
}
|
||||
|
||||
// Update xp level
|
||||
if (pMinecraft->localgameModes[m_iPad]->hasExperience() && pMinecraft->localplayers[m_iPad]->experienceLevel > 0)
|
||||
{
|
||||
SetExpLevel(pMinecraft->localplayers[m_iPad]->experienceLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetExpLevel(0);
|
||||
}
|
||||
|
||||
if (pMinecraft->localgameModes[m_iPad]->canHurtPlayer())
|
||||
{
|
||||
ShowHealth(true);
|
||||
|
||||
@@ -10,12 +10,12 @@ UIScene_HelpAndOptionsMenu::UIScene_HelpAndOptionsMenu(int iPad, void *initData,
|
||||
|
||||
m_bNotInGame=(Minecraft::GetInstance()->level==NULL);
|
||||
|
||||
m_buttons[BUTTON_HAO_CHANGESKIN].init(app.GetString(IDS_CHANGE_SKIN),BUTTON_HAO_CHANGESKIN);
|
||||
m_buttons[BUTTON_HAO_HOWTOPLAY].init(app.GetString(IDS_HOW_TO_PLAY),BUTTON_HAO_HOWTOPLAY);
|
||||
m_buttons[BUTTON_HAO_CONTROLS].init(app.GetString(IDS_CONTROLS),BUTTON_HAO_CONTROLS);
|
||||
m_buttons[BUTTON_HAO_SETTINGS].init(app.GetString(IDS_SETTINGS),BUTTON_HAO_SETTINGS);
|
||||
m_buttons[BUTTON_HAO_CREDITS].init(app.GetString(IDS_CREDITS),BUTTON_HAO_CREDITS);
|
||||
//m_buttons[BUTTON_HAO_REINSTALL].init(app.GetString(IDS_REINSTALL_CONTENT),BUTTON_HAO_REINSTALL);
|
||||
m_buttons[BUTTON_HAO_RESETTODEFAULTS].init(app.GetString(IDS_RESET_TO_DEFAULTS),BUTTON_HAO_RESETTODEFAULTS);
|
||||
m_buttons[BUTTON_HAO_DEBUG].init(app.GetString(IDS_DEBUG_SETTINGS),BUTTON_HAO_DEBUG);
|
||||
|
||||
/* 4J-TomK - we should never remove a control before the other buttons controls are initialised!
|
||||
@@ -70,11 +70,6 @@ UIScene_HelpAndOptionsMenu::UIScene_HelpAndOptionsMenu(int iPad, void *initData,
|
||||
}
|
||||
}
|
||||
|
||||
if(!ProfileManager.IsFullVersion() )//|| ProfileManager.IsGuest(m_iPad))
|
||||
{
|
||||
removeControl( &m_buttons[BUTTON_HAO_CHANGESKIN], false);
|
||||
}
|
||||
|
||||
//StorageManager.TMSPP_GetUserQuotaInfo(C4JStorage::eGlobalStorage_TitleUser,iPad);
|
||||
//StorageManager.WebServiceRequestGetFriends(iPad);
|
||||
}
|
||||
@@ -165,11 +160,6 @@ void UIScene_HelpAndOptionsMenu::handleReload()
|
||||
#endif
|
||||
}
|
||||
|
||||
if(!ProfileManager.IsFullVersion() )//|| ProfileManager.IsGuest(m_iPad))
|
||||
{
|
||||
removeControl( &m_buttons[BUTTON_HAO_CHANGESKIN], false);
|
||||
}
|
||||
|
||||
doHorizontalResizeCheck();
|
||||
}
|
||||
|
||||
@@ -208,9 +198,6 @@ void UIScene_HelpAndOptionsMenu::handlePress(F64 controlId, F64 childId)
|
||||
{
|
||||
switch((int)controlId)
|
||||
{
|
||||
case BUTTON_HAO_CHANGESKIN:
|
||||
ui.NavigateToScene(m_iPad, eUIScene_SkinSelectMenu);
|
||||
break;
|
||||
case BUTTON_HAO_HOWTOPLAY:
|
||||
ui.NavigateToScene(m_iPad, eUIScene_HowToPlayMenu);
|
||||
break;
|
||||
@@ -223,6 +210,15 @@ void UIScene_HelpAndOptionsMenu::handlePress(F64 controlId, F64 childId)
|
||||
case BUTTON_HAO_CREDITS:
|
||||
ui.NavigateToScene(m_iPad, eUIScene_Credits);
|
||||
break;
|
||||
case BUTTON_HAO_RESETTODEFAULTS:
|
||||
{
|
||||
UINT uiIDA[2];
|
||||
uiIDA[0]=IDS_CONFIRM_CANCEL;
|
||||
uiIDA[1]=IDS_CONFIRM_OK;
|
||||
|
||||
ui.RequestMessageBox(IDS_DEFAULTS_TITLE, IDS_DEFAULTS_TEXT, uiIDA, 2, m_iPad,&UIScene_HelpAndOptionsMenu::ResetDefaultsDialogReturned,this, app.GetStringTable(), NULL, 0, false);
|
||||
}
|
||||
break;
|
||||
case BUTTON_HAO_REINSTALL:
|
||||
ui.NavigateToScene(m_iPad, eUIScene_ReinstallMenu);
|
||||
break;
|
||||
@@ -231,3 +227,22 @@ void UIScene_HelpAndOptionsMenu::handlePress(F64 controlId, F64 childId)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int UIScene_HelpAndOptionsMenu::ResetDefaultsDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
UIScene_HelpAndOptionsMenu* pClass = (UIScene_HelpAndOptionsMenu*)pParam;
|
||||
|
||||
// results switched for this dialog
|
||||
if(result==C4JStorage::EMessage_ResultDecline)
|
||||
{
|
||||
#if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
|
||||
app.SetDefaultOptions(StorageManager.GetDashboardProfileSettings(pClass->m_iPad),pClass->m_iPad);
|
||||
#else
|
||||
app.SetDefaultOptions(ProfileManager.GetDashboardProfileSettings(pClass->m_iPad),pClass->m_iPad);
|
||||
#endif
|
||||
// if the profile data has been changed, then force a profile write
|
||||
// It seems we're allowed to break the 5 minute rule if it's the result of a user action
|
||||
app.CheckGameSettingsChanged(true,iPad);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
#include "UIScene.h"
|
||||
|
||||
#define BUTTON_HAO_CHANGESKIN 0
|
||||
#define BUTTON_HAO_HOWTOPLAY 1
|
||||
#define BUTTON_HAO_CONTROLS 2
|
||||
#define BUTTON_HAO_SETTINGS 3
|
||||
#define BUTTON_HAO_CREDITS 4
|
||||
#define BUTTON_HAO_REINSTALL 5
|
||||
#define BUTTON_HAO_HOWTOPLAY 0
|
||||
#define BUTTON_HAO_CONTROLS 1
|
||||
#define BUTTON_HAO_SETTINGS 2
|
||||
#define BUTTON_HAO_CREDITS 3
|
||||
#define BUTTON_HAO_REINSTALL 4
|
||||
#define BUTTON_HAO_RESETTODEFAULTS 5
|
||||
#define BUTTON_HAO_DEBUG 6
|
||||
#define BUTTONS_HAO_MAX BUTTON_HAO_DEBUG + 1
|
||||
|
||||
@@ -16,12 +16,12 @@ class UIScene_HelpAndOptionsMenu : public UIScene
|
||||
private:
|
||||
UIControl_Button m_buttons[BUTTONS_HAO_MAX];
|
||||
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_CHANGESKIN], "Button1")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_HOWTOPLAY], "Button2")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_CONTROLS], "Button3")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_SETTINGS], "Button4")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_CREDITS], "Button5")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_REINSTALL], "Button6")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_HOWTOPLAY], "Button1")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_CONTROLS], "Button2")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_SETTINGS], "Button3")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_CREDITS], "Button4")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_REINSTALL], "Button5")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_RESETTODEFAULTS], "Button6")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_DEBUG], "Button7")
|
||||
UI_END_MAP_ELEMENTS_AND_NAMES()
|
||||
|
||||
@@ -47,4 +47,6 @@ public:
|
||||
|
||||
protected:
|
||||
void handlePress(F64 controlId, F64 childId);
|
||||
|
||||
static int ResetDefaultsDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
};
|
||||
@@ -56,22 +56,6 @@ HRESULT CXuiCtrlEnchantmentButton::OnGetSourceDataText(XUIMessageGetSourceText *
|
||||
|
||||
int cost = menu->costs[m_index];
|
||||
|
||||
if(cost != m_lastCost)
|
||||
{
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
if(cost > pMinecraft->localplayers[m_iPad]->experienceLevel && !pMinecraft->localplayers[m_iPad]->abilities.instabuild)
|
||||
{
|
||||
// Dark background
|
||||
SetEnable(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Light background and focus background
|
||||
SetEnable(TRUE);
|
||||
}
|
||||
m_costString = _toString<int>(cost);
|
||||
m_lastCost = cost;
|
||||
}
|
||||
if(cost == 0)
|
||||
{
|
||||
// Dark background
|
||||
|
||||
@@ -122,36 +122,6 @@ HRESULT CXuiCtrlEnchantmentButtonText::OnRender(XUIMessageRender *pRenderData, B
|
||||
}
|
||||
|
||||
glColor4f(1, 1, 1, 1);
|
||||
if (cost != 0)
|
||||
{
|
||||
wstring line = _toString<int>(cost);
|
||||
Font *font = pMinecraft->altFont;
|
||||
//int col = 0x685E4A;
|
||||
unsigned int col = m_textColour;
|
||||
if (pMinecraft->localplayers[m_parentControl->m_iPad]->experienceLevel < cost && !pMinecraft->localplayers[m_parentControl->m_iPad]->abilities.instabuild)
|
||||
{
|
||||
col = m_textDisabledColour;
|
||||
font->drawWordWrap(m_enchantmentString, 0, 0, bwidth/ss, col, bheight/ss);
|
||||
font = pMinecraft->font;
|
||||
//col = (0x80ff20 & 0xfefefe) >> 1;
|
||||
//font->drawShadow(line, (bwidth - font->width(line))/ss, 7, col);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_parentControl->HasFocus())
|
||||
{
|
||||
//col = 0xffff80;
|
||||
col = m_textFocusColour;
|
||||
}
|
||||
font->drawWordWrap(m_enchantmentString, 0, 0, bwidth/ss, col, bheight/ss);
|
||||
font = pMinecraft->font;
|
||||
//col = 0x80ff20;
|
||||
//font->drawShadow(line, (bwidth - font->width(line))/ss, 7, col);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
//Lighting::turnOff();
|
||||
glDisable(GL_RESCALE_NORMAL);
|
||||
|
||||
@@ -141,36 +141,6 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene()
|
||||
m_hotbarIcon[j]->SetAlpha( m_hotbarIcon[j]->m_hObj, opacity );
|
||||
}
|
||||
|
||||
// Update xp progress
|
||||
if (pMinecraft->localgameModes[m_iPad]->canHurtPlayer())
|
||||
{
|
||||
int xpNeededForNextLevel = pMinecraft->localplayers[m_iPad]->getXpNeededForNextLevel();
|
||||
int progress = (int)(pMinecraft->localplayers[m_iPad]->experienceProgress *xpNeededForNextLevel);
|
||||
|
||||
m_ExperienceProgress.SetShow(TRUE);
|
||||
m_ExperienceProgress.SetRange(0,xpNeededForNextLevel);
|
||||
m_ExperienceProgress.SetValue(progress);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ExperienceProgress.SetShow(FALSE);
|
||||
}
|
||||
|
||||
// Update xp level
|
||||
if (pMinecraft->localgameModes[m_iPad]->hasExperience() && pMinecraft->localplayers[m_iPad]->experienceLevel > 0)
|
||||
{
|
||||
m_xpLevel.SetShow(TRUE);
|
||||
|
||||
wchar_t formatted[10];
|
||||
swprintf(formatted, 10, L"%d",pMinecraft->localplayers[m_iPad]->experienceLevel);
|
||||
|
||||
m_xpLevel.SetText(formatted);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_xpLevel.SetShow(FALSE);
|
||||
}
|
||||
|
||||
if (pMinecraft->localgameModes[m_iPad]->canHurtPlayer())
|
||||
{
|
||||
m_random.setSeed(m_tickCount * 312871);
|
||||
|
||||
@@ -16,7 +16,6 @@ protected:
|
||||
CXuiControl m_hudScaleGroup; // Contains all the HUD elements except crosshair
|
||||
CXuiControl m_hotbarGroup;
|
||||
CXuiCtrlSlotItem *m_hotbarIcon[9];
|
||||
CXuiProgressBar m_ExperienceProgress;
|
||||
CXuiControl m_healthGroup;
|
||||
CXuiControl m_healthIcon[10];
|
||||
CXuiControl m_armourGroup;
|
||||
@@ -25,7 +24,6 @@ protected:
|
||||
CXuiControl m_foodIcon[10];
|
||||
CXuiControl m_airGroup;
|
||||
CXuiControl m_airIcon[10];
|
||||
CXuiControl m_xpLevel;
|
||||
|
||||
D3DXVECTOR3 m_OriginalPosition;
|
||||
int m_iPad;
|
||||
@@ -58,7 +56,6 @@ protected:
|
||||
MAP_OVERRIDE(IDC_Inventory8, m_hotbarIcon[7])
|
||||
MAP_OVERRIDE(IDC_Inventory9, m_hotbarIcon[8])
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
MAP_CONTROL(IDC_ExperienceProgress, m_ExperienceProgress)
|
||||
MAP_CONTROL(IDC_Health, m_healthGroup)
|
||||
BEGIN_MAP_CHILD_CONTROLS(m_healthGroup)
|
||||
MAP_CONTROL(IDC_Health0, m_healthIcon[0])
|
||||
@@ -111,7 +108,6 @@ protected:
|
||||
MAP_CONTROL(IDC_Air8, m_airIcon[8])
|
||||
MAP_CONTROL(IDC_Air9, m_airIcon[9])
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
MAP_CONTROL(IDC_XPLevel, m_xpLevel)
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include "HumanoidMobRenderer.h"
|
||||
#include "DefaultRenderer.h"
|
||||
#include "EndermanRenderer.h"
|
||||
#include "ExperienceOrbRenderer.h"
|
||||
#include "SilverfishRenderer.h"
|
||||
#include "MushroomCowRenderer.h"
|
||||
#include "SnowmanRenderer.h"
|
||||
@@ -123,12 +122,10 @@ EntityRenderDispatcher::EntityRenderDispatcher()
|
||||
renderers[eTYPE_EYEOFENDERSIGNAL] = new ItemSpriteRenderer(Item::eyeOfEnder);
|
||||
renderers[eTYPE_THROWNEGG] = new ItemSpriteRenderer(Item::egg);
|
||||
renderers[eTYPE_THROWNPOTION] = new ItemSpriteRenderer(Item::potion, PotionBrewing::THROWABLE_MASK);
|
||||
renderers[eTYPE_THROWNEXPBOTTLE] = new ItemSpriteRenderer(Item::expBottle);
|
||||
renderers[eTYPE_FIREBALL] = new FireballRenderer(2.0f);
|
||||
renderers[eTYPE_SMALL_FIREBALL] = new FireballRenderer(0.5f);
|
||||
renderers[eTYPE_DRAGON_FIREBALL] = new FireballRenderer(2.0f); // 4J Added TU9
|
||||
renderers[eTYPE_ITEMENTITY] = new ItemRenderer();
|
||||
renderers[eTYPE_EXPERIENCEORB] = new ExperienceOrbRenderer();
|
||||
renderers[eTYPE_PRIMEDTNT] = new TntRenderer();
|
||||
renderers[eTYPE_FALLINGTILE] = new FallingTileRenderer();
|
||||
renderers[eTYPE_MINECART] = new MinecartRenderer();
|
||||
|
||||
@@ -50,7 +50,6 @@ void EntityTracker::addEntity(shared_ptr<Entity> e)
|
||||
else if (e->GetType() == eTYPE_EYEOFENDERSIGNAL ) addEntity(e, 16 * 4, 4, true);
|
||||
else if (e->GetType() == eTYPE_THROWNEGG) addEntity(e, 16 * 4, 10, true);
|
||||
else if (e->GetType() == eTYPE_THROWNPOTION ) addEntity(e, 16 * 4, 10, true);
|
||||
else if (e->GetType() == eTYPE_THROWNEXPBOTTLE) addEntity(e, 16 * 4, 10, true);
|
||||
else if (e->GetType() == eTYPE_ITEMENTITY) addEntity(e, 16 * 4, 20, true);
|
||||
else if (e->GetType() == eTYPE_MINECART) addEntity(e, 16 * 5, 3, true);
|
||||
else if (e->GetType() == eTYPE_BOAT) addEntity(e, 16 * 5, 3, true);
|
||||
@@ -60,7 +59,6 @@ void EntityTracker::addEntity(shared_ptr<Entity> e)
|
||||
else if (e->GetType() == eTYPE_PRIMEDTNT) addEntity(e, 16 * 10, 10, true);
|
||||
else if (e->GetType() == eTYPE_FALLINGTILE) addEntity(e, 16 * 10, 20, true);
|
||||
else if (e->GetType() == eTYPE_PAINTING) addEntity(e, 16 * 10, INT_MAX, false);
|
||||
else if (e->GetType() == eTYPE_EXPERIENCEORB) addEntity(e, 16 * 10, 20, true);
|
||||
else if (e->GetType() == eTYPE_ENDER_CRYSTAL) addEntity(e, 16 * 16, INT_MAX, false);
|
||||
else if (e->GetType() == eTYPE_ITEM_FRAME) addEntity(e, 16 * 10, INT_MAX, false);
|
||||
}
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "ExperienceOrbRenderer.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.level.tile.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.item.h"
|
||||
#include "Tesselator.h"
|
||||
#include "EntityRenderDispatcher.h"
|
||||
#include "..\Minecraft.World\Mth.h"
|
||||
#include "..\Minecraft.World\JavaMath.h"
|
||||
|
||||
ExperienceOrbRenderer::ExperienceOrbRenderer()
|
||||
{
|
||||
// 4J In class Java initialisors
|
||||
tileRenderer = new TileRenderer();
|
||||
setColor = true;
|
||||
|
||||
this->shadowRadius = 0.15f;
|
||||
this->shadowStrength = 0.75f;
|
||||
}
|
||||
|
||||
|
||||
void ExperienceOrbRenderer::render(shared_ptr<Entity> _orb, double x, double y, double z, float rot, float a)
|
||||
{
|
||||
shared_ptr<ExperienceOrb> orb = dynamic_pointer_cast<ExperienceOrb>(_orb);
|
||||
glPushMatrix();
|
||||
glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
int icon = orb->getIcon();
|
||||
bindTexture(TN_ITEM_EXPERIENCE_ORB); // 4J was L"/item/xporb.png"
|
||||
Tesselator *t = Tesselator::getInstance();
|
||||
|
||||
float u0 = ((icon % 4) * 16 + 0) / 64.0f;
|
||||
float u1 = ((icon % 4) * 16 + 16) / 64.0f;
|
||||
float v0 = ((icon / 4) * 16 + 0) / 64.0f;
|
||||
float v1 = ((icon / 4) * 16 + 16) / 64.0f;
|
||||
|
||||
|
||||
float r = 1.0f;
|
||||
float xo = 0.5f;
|
||||
float yo = 0.25f;
|
||||
|
||||
if (SharedConstants::TEXTURE_LIGHTING)
|
||||
{
|
||||
int col = orb->getLightColor(a);
|
||||
int u = col % 65536;
|
||||
int v = col / 65536;
|
||||
glMultiTexCoord2f(GL_TEXTURE1, u / 1.0f, v / 1.0f);
|
||||
glColor4f(1, 1, 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
float br = orb->getBrightness(a);
|
||||
glColor4f(br, br, br, 1);
|
||||
}
|
||||
float br = 255.0f;
|
||||
float rr = (orb->tickCount + a) / 2;
|
||||
int rc = (int) ((Mth::sin(rr + 0 * PI * 2 / 3) + 1) * 0.5f * br);
|
||||
int gc = (int) (br);
|
||||
int bc = (int) ((Mth::sin(rr + 2 * PI * 2 / 3) + 1) * 0.1f * br);
|
||||
int col = rc << 16 | gc << 8 | bc;
|
||||
glRotatef(180 - entityRenderDispatcher->playerRotY, 0, 1, 0);
|
||||
glRotatef(-entityRenderDispatcher->playerRotX, 1, 0, 0);
|
||||
float s = 0.3f;
|
||||
glScalef(s, s, s);
|
||||
t->begin();
|
||||
t->color(col, 128);
|
||||
t->normal(0, 1, 0);
|
||||
t->vertexUV(0 - xo, 0 - yo, 0, u0, v1);
|
||||
t->vertexUV(r - xo, 0 - yo, 0, u1, v1);
|
||||
t->vertexUV(r - xo, 1 - yo, 0, u1, v0);
|
||||
t->vertexUV(0 - xo, 1 - yo, 0, u0, v0);
|
||||
t->end();
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_RESCALE_NORMAL);
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
void ExperienceOrbRenderer::blit(int x, int y, int sx, int sy, int w, int h)
|
||||
{
|
||||
float blitOffset = 0;
|
||||
float us = 1 / 256.0f;
|
||||
float vs = 1 / 256.0f;
|
||||
Tesselator *t = Tesselator::getInstance();
|
||||
t->begin();
|
||||
t->vertexUV(x + 0, y + h, blitOffset, (sx + 0) * us, (sy + h) * vs);
|
||||
t->vertexUV(x + w, y + h, blitOffset, (sx + w) * us, (sy + h) * vs);
|
||||
t->vertexUV(x + w, y + 0, blitOffset, (sx + w) * us, (sy + 0) * vs);
|
||||
t->vertexUV(x + 0, y + 0, blitOffset, (sx + 0) * us, (sy + 0) * vs);
|
||||
t->end();
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "EntityRenderer.h"
|
||||
|
||||
class ExperienceOrbRenderer : public EntityRenderer
|
||||
{
|
||||
private:
|
||||
TileRenderer *tileRenderer;
|
||||
|
||||
public:
|
||||
bool setColor;
|
||||
|
||||
ExperienceOrbRenderer();
|
||||
|
||||
void render(shared_ptr<Entity> _orb, double x, double y, double z, float rot, float a);
|
||||
void blit(int x, int y, int sx, int sy, int w, int h);
|
||||
};
|
||||
@@ -41,7 +41,6 @@ public:
|
||||
|
||||
virtual bool isCutScene();
|
||||
virtual void releaseUsingItem(shared_ptr<Player> player);
|
||||
virtual bool hasExperience();
|
||||
virtual bool hasMissTime();
|
||||
virtual bool hasInfiniteItems();
|
||||
virtual bool hasFarPickRange();
|
||||
|
||||
@@ -618,48 +618,6 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
||||
}
|
||||
}
|
||||
|
||||
#if RENDER_HUD
|
||||
// Moved so the opacity blend is applied to it
|
||||
if (bDisplayGui && minecraft->gameMode->hasExperience() && minecraft->player->experienceLevel > 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
bool blink = false;
|
||||
int col = blink ? 0xffffff : 0x80ff20;
|
||||
wchar_t formatted[10];
|
||||
swprintf(formatted, 10, L"%d",minecraft->player->experienceLevel);
|
||||
|
||||
wstring str = formatted;
|
||||
int x = iWidthOffset + (screenWidth - font->width(str)) / 2;
|
||||
int y = screenHeight - iSafezoneYHalf - iTooltipsYOffset;
|
||||
// If we're in creative mode, we don't need to offset the XP display so much
|
||||
if (minecraft->gameMode->canHurtPlayer())
|
||||
{
|
||||
y-=18;
|
||||
}
|
||||
else
|
||||
{
|
||||
y-=13;
|
||||
}
|
||||
|
||||
if(bTwoPlayerSplitscreen)
|
||||
{
|
||||
y+=iHeightOffset;
|
||||
}
|
||||
//int y = screenHeight - 31 - 4;
|
||||
font->draw(str, x + 1, y, 0x000000);
|
||||
font->draw(str, x - 1, y, 0x000000);
|
||||
font->draw(str, x, y + 1, 0x000000);
|
||||
font->draw(str, x, y - 1, 0x000000);
|
||||
// font->draw(str, x + 1, y + 1, 0x000000);
|
||||
// font->draw(str, x - 1, y + 1, 0x000000);
|
||||
// font->draw(str, x + 1, y - 1, 0x000000);
|
||||
// font->draw(str, x - 1, y - 1, 0x000000);
|
||||
font->draw(str, x, y, col);
|
||||
}
|
||||
}
|
||||
#endif // RENDER_HUD
|
||||
|
||||
// 4J - added to disable blends, which we have enabled previously to allow gui fading
|
||||
glDisable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -719,46 +677,8 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
||||
font->drawShadow(minecraft->gatherStats3(), iSafezoneXHalf+2, 32 + 30, 0xffffff);
|
||||
font->drawShadow(minecraft->gatherStats4(), iSafezoneXHalf+2, 32 + 40, 0xffffff);
|
||||
|
||||
// TERRAIN FEATURES
|
||||
int iYPos=82;
|
||||
|
||||
if(minecraft->level->dimension->id==0)
|
||||
{
|
||||
wstring wfeature[eTerrainFeature_Count];
|
||||
|
||||
wfeature[eTerrainFeature_Stronghold] = L"Stronghold: ";
|
||||
wfeature[eTerrainFeature_Mineshaft] = L"Mineshaft: ";
|
||||
wfeature[eTerrainFeature_Village] = L"Village: ";
|
||||
wfeature[eTerrainFeature_Ravine] = L"Ravine: ";
|
||||
|
||||
for(int i=0;i<app.m_vTerrainFeatures.size();i++)
|
||||
{
|
||||
FEATURE_DATA *pFeatureData=app.m_vTerrainFeatures[i];
|
||||
|
||||
wstring itemInfo = L"[" + _toString<int>( pFeatureData->x*16 ) + L", " + _toString<int>( pFeatureData->z*16 ) + L"] ";
|
||||
wfeature[pFeatureData->eTerrainFeature] += itemInfo;
|
||||
}
|
||||
|
||||
for( int i = eTerrainFeature_Stronghold; i < (int) eTerrainFeature_Count; i++ )
|
||||
{
|
||||
font->drawShadow(wfeature[i], iSafezoneXHalf + 2, iYPos, 0xffffff);
|
||||
iYPos+=10;
|
||||
}
|
||||
}
|
||||
|
||||
//font->drawShadow(minecraft->gatherStats5(), iSafezoneXHalf+2, 32 + 10, 0xffffff);
|
||||
{
|
||||
/* 4J - removed
|
||||
long max = Runtime.getRuntime().maxMemory();
|
||||
long total = Runtime.getRuntime().totalMemory();
|
||||
long free = Runtime.getRuntime().freeMemory();
|
||||
long used = total - free;
|
||||
String msg = "Used memory: " + (used * 100 / max) + "% (" + (used / 1024 / 1024) + "MB) of " + (max / 1024 / 1024) + "MB";
|
||||
drawString(font, msg, screenWidth - font.width(msg) - 2, 2, 0xe0e0e0);
|
||||
msg = "Allocated memory: " + (total * 100 / max) + "% (" + (total / 1024 / 1024) + "MB)";
|
||||
drawString(font, msg, screenWidth - font.width(msg) - 2, 12, 0xe0e0e0);
|
||||
*/
|
||||
}
|
||||
// 4J Stu - Moved these so that they don't overlap
|
||||
double xBlockPos = floor(minecraft->player->x);
|
||||
double yBlockPos = floor(minecraft->player->y);
|
||||
|
||||
@@ -1044,13 +1044,6 @@ bool LocalPlayer::checkInTile(double x, double y, double z)
|
||||
|
||||
}
|
||||
|
||||
void LocalPlayer::setExperienceValues(float experienceProgress, int totalExp, int experienceLevel)
|
||||
{
|
||||
this->experienceProgress = experienceProgress;
|
||||
this->totalExperience = totalExp;
|
||||
this->experienceLevel = experienceLevel;
|
||||
}
|
||||
|
||||
bool LocalPlayer::hasPermission(EGameCommand command)
|
||||
{
|
||||
return level->getLevelData()->getAllowCommands();
|
||||
|
||||
@@ -171,8 +171,6 @@ protected:
|
||||
bool checkInTile(double x, double y, double z);
|
||||
|
||||
public:
|
||||
void setExperienceValues(float experienceProgress, int totalExp, int experienceLevel);
|
||||
|
||||
bool hasPermission(EGameCommand command);
|
||||
|
||||
void updateRichPresence();
|
||||
|
||||
@@ -8043,7 +8043,6 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ClInclude Include="EntityTileRenderer.h" />
|
||||
<ClInclude Include="EntityTracker.h" />
|
||||
<ClInclude Include="ErrorScreen.h" />
|
||||
<ClInclude Include="ExperienceOrbRenderer.h" />
|
||||
<ClInclude Include="ExplodeParticle.h" />
|
||||
<ClInclude Include="extraX64client.h" />
|
||||
<ClInclude Include="FallingTileRenderer.h" />
|
||||
@@ -25398,7 +25397,6 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ClCompile Include="EntityTileRenderer.cpp" />
|
||||
<ClCompile Include="EntityTracker.cpp" />
|
||||
<ClCompile Include="ErrorScreen.cpp" />
|
||||
<ClCompile Include="ExperienceOrbRenderer.cpp" />
|
||||
<ClCompile Include="ExplodeParticle.cpp" />
|
||||
<ClCompile Include="Extrax64Stubs.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
|
||||
@@ -1756,9 +1756,6 @@
|
||||
<ClInclude Include="EndermanRenderer.h">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ExperienceOrbRenderer.h">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SilverfishRenderer.h">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClInclude>
|
||||
@@ -4359,9 +4356,6 @@
|
||||
<ClCompile Include="EndermanRenderer.cpp">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ExperienceOrbRenderer.cpp">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SilverfishRenderer.cpp">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClCompile>
|
||||
|
||||
@@ -2436,10 +2436,6 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
*piUse=IDS_TOOLTIPS_THROW;
|
||||
}
|
||||
break;
|
||||
|
||||
case Item::expBottle_Id:
|
||||
if (bUseItem) *piUse=IDS_TOOLTIPS_THROW;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -442,11 +442,6 @@ void MultiPlayerGameMode::releaseUsingItem(shared_ptr<Player> player)
|
||||
player->releaseUsingItem();
|
||||
}
|
||||
|
||||
bool MultiPlayerGameMode::hasExperience()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MultiPlayerGameMode::hasMissTime()
|
||||
{
|
||||
return !localPlayerMode->isCreative();
|
||||
|
||||
@@ -51,7 +51,6 @@ public:
|
||||
virtual void handleCreativeModeItemAdd(shared_ptr<ItemInstance> clicked, int slot);
|
||||
virtual void handleCreativeModeItemDrop(shared_ptr<ItemInstance> clicked);
|
||||
virtual void releaseUsingItem(shared_ptr<Player> player);
|
||||
virtual bool hasExperience();
|
||||
virtual bool hasMissTime();
|
||||
virtual bool hasInfiniteItems();
|
||||
virtual bool hasFarPickRange();
|
||||
|
||||
@@ -484,7 +484,6 @@ void PreStitchedTextureMap::loadUVs()
|
||||
texturesByName.insert(stringIconMap::value_type(L"minecartFurnace",new SimpleIcon(L"minecartFurnace",slotSize*7,slotSize*10,slotSize*(7+1),slotSize*(10+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"monsterPlacer_overlay",new SimpleIcon(L"monsterPlacer_overlay",slotSize*9,slotSize*10,slotSize*(9+1),slotSize*(10+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"ruby",new SimpleIcon(L"ruby",slotSize*10,slotSize*10,slotSize*(10+1),slotSize*(10+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"expBottle",new SimpleIcon(L"expBottle",slotSize*11,slotSize*10,slotSize*(11+1),slotSize*(10+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"brewingStand",new SimpleIcon(L"brewingStand",slotSize*12,slotSize*10,slotSize*(12+1),slotSize*(10+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"magmaCream",new SimpleIcon(L"magmaCream",slotSize*13,slotSize*10,slotSize*(13+1),slotSize*(10+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"dyePowder_cyan",new SimpleIcon(L"dyePowder_cyan",slotSize*14,slotSize*10,slotSize*(14+1),slotSize*(10+1))));
|
||||
|
||||
@@ -14,7 +14,6 @@ ServerCommandDispatcher::ServerCommandDispatcher()
|
||||
addCommand(new DefaultGameModeCommand());
|
||||
addCommand(new KillCommand());
|
||||
addCommand(new ToggleDownfallCommand());
|
||||
addCommand(new ExperienceCommand());
|
||||
addCommand(new TeleportCommand());
|
||||
addCommand(new GiveItemCommand());
|
||||
addCommand(new EnchantItemCommand());
|
||||
|
||||
@@ -1228,18 +1228,6 @@ bool ServerLevel::addEntity(shared_ptr<Entity> e)
|
||||
}
|
||||
LeaveCriticalSection(&m_limiterCS);
|
||||
}
|
||||
// If its an experience orb entity, and we've got to our capacity, delete the oldest
|
||||
else if( dynamic_pointer_cast<ExperienceOrb>(e) != NULL )
|
||||
{
|
||||
// printf("Adding arrow entity count %d\n",m_arrowEntities.size());
|
||||
EnterCriticalSection(&m_limiterCS);
|
||||
if( m_experienceOrbEntities.size() >= MAX_EXPERIENCEORB_ENTITIES )
|
||||
{
|
||||
// printf("Adding - doing remove\n");
|
||||
removeEntityImmediately(m_experienceOrbEntities.front());
|
||||
}
|
||||
LeaveCriticalSection(&m_limiterCS);
|
||||
}
|
||||
return Level::addEntity(e);
|
||||
}
|
||||
|
||||
@@ -1267,13 +1255,6 @@ void ServerLevel::entityAddedExtra(shared_ptr<Entity> e)
|
||||
// printf("entity added: arrow entity count now %d\n",m_arrowEntities.size());
|
||||
LeaveCriticalSection(&m_limiterCS);
|
||||
}
|
||||
else if( dynamic_pointer_cast<ExperienceOrb>(e) != NULL )
|
||||
{
|
||||
EnterCriticalSection(&m_limiterCS);
|
||||
m_experienceOrbEntities.push_back(e);
|
||||
// printf("entity added: experience orb entity count now %d\n",m_arrowEntities.size());
|
||||
LeaveCriticalSection(&m_limiterCS);
|
||||
}
|
||||
else if( dynamic_pointer_cast<PrimedTnt>(e) != NULL )
|
||||
{
|
||||
EnterCriticalSection(&m_limiterCS);
|
||||
@@ -1330,19 +1311,6 @@ void ServerLevel::entityRemovedExtra(shared_ptr<Entity> e)
|
||||
// printf("entity removed: arrow entity count now %d\n",m_arrowEntities.size());
|
||||
LeaveCriticalSection(&m_limiterCS);
|
||||
}
|
||||
else if( dynamic_pointer_cast<ExperienceOrb>(e) != NULL )
|
||||
{
|
||||
EnterCriticalSection(&m_limiterCS);
|
||||
// printf("entity removed: experience orb entity count %d\n",m_arrowEntities.size());
|
||||
AUTO_VAR(it, find(m_experienceOrbEntities.begin(),m_experienceOrbEntities.end(),e));
|
||||
if( it != m_experienceOrbEntities.end() )
|
||||
{
|
||||
// printf("Item to remove found\n");
|
||||
m_experienceOrbEntities.erase(it);
|
||||
}
|
||||
// printf("entity removed: experience orb entity count now %d\n",m_arrowEntities.size());
|
||||
LeaveCriticalSection(&m_limiterCS);
|
||||
}
|
||||
else if( dynamic_pointer_cast<PrimedTnt>(e) != NULL )
|
||||
{
|
||||
EnterCriticalSection(&m_limiterCS);
|
||||
|
||||
@@ -127,7 +127,6 @@ public:
|
||||
static const int MAX_HANGING_ENTITIES = 400;
|
||||
static const int MAX_ITEM_ENTITIES = 200;
|
||||
static const int MAX_ARROW_ENTITIES = 200;
|
||||
static const int MAX_EXPERIENCEORB_ENTITIES = 50;
|
||||
static const int MAX_PRIMED_TNT = 20;
|
||||
static const int MAX_FALLING_TILE = 20;
|
||||
|
||||
@@ -137,7 +136,6 @@ public:
|
||||
list< shared_ptr<Entity> > m_itemEntities;
|
||||
list< shared_ptr<Entity> > m_hangingEntities;
|
||||
list< shared_ptr<Entity> > m_arrowEntities;
|
||||
list< shared_ptr<Entity> > m_experienceOrbEntities;
|
||||
|
||||
virtual bool addEntity(shared_ptr<Entity> e);
|
||||
void entityAddedExtra(shared_ptr<Entity> e);
|
||||
|
||||
@@ -190,12 +190,6 @@ void ServerPlayer::addAdditonalSaveData(CompoundTag *entityTag)
|
||||
//entityTag->putInt(L"playerGameType", gameMode->getGameModeForPlayer()->getId());
|
||||
}
|
||||
|
||||
void ServerPlayer::withdrawExperienceLevels(int amount)
|
||||
{
|
||||
Player::withdrawExperienceLevels(amount);
|
||||
lastSentExp = -1;
|
||||
}
|
||||
|
||||
void ServerPlayer::initMenu()
|
||||
{
|
||||
containerMenu->addSlotListener(this);
|
||||
@@ -546,13 +540,6 @@ void ServerPlayer::doTickB(bool ignorePortal)
|
||||
lastSentFood = foodData.getFoodLevel();
|
||||
lastFoodSaturationZero = foodData.getSaturationLevel() == 0;
|
||||
}
|
||||
|
||||
if (totalExperience != lastSentExp)
|
||||
{
|
||||
lastSentExp = totalExperience;
|
||||
connection->send( shared_ptr<SetExperiencePacket>( new SetExperiencePacket(experienceProgress, totalExperience, experienceLevel) ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
shared_ptr<ItemInstance> ServerPlayer::getCarried(int slot)
|
||||
@@ -760,10 +747,6 @@ void ServerPlayer::take(shared_ptr<Entity> e, int orgCount)
|
||||
{
|
||||
entityTracker->broadcast(e, shared_ptr<TakeItemEntityPacket>( new TakeItemEntityPacket(e->entityId, entityId) ) );
|
||||
}
|
||||
if (e->GetType() == eTYPE_EXPERIENCEORB)
|
||||
{
|
||||
entityTracker->broadcast(e, shared_ptr<TakeItemEntityPacket>( new TakeItemEntityPacket(e->entityId, entityId) ) );
|
||||
}
|
||||
}
|
||||
Player::take(e, orgCount);
|
||||
containerMenu->broadcastChanges();
|
||||
|
||||
@@ -45,7 +45,6 @@ public:
|
||||
|
||||
virtual void readAdditionalSaveData(CompoundTag *entityTag);
|
||||
virtual void addAdditonalSaveData(CompoundTag *entityTag);
|
||||
virtual void withdrawExperienceLevels(int amount);
|
||||
void initMenu();
|
||||
|
||||
private:
|
||||
|
||||
@@ -28,5 +28,4 @@ public:
|
||||
virtual shared_ptr<Player> createPlayer(Level *level);
|
||||
virtual void tick();
|
||||
virtual bool useItemOn(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem=NULL);
|
||||
virtual bool hasExperience();
|
||||
};
|
||||
@@ -79,7 +79,6 @@ wchar_t *Textures::preLoaded[TN_COUNT] =
|
||||
L"mob/silverfish",
|
||||
L"mob/enderman_eyes",
|
||||
L"misc/explosion",
|
||||
L"item/xporb",
|
||||
L"item/chest",
|
||||
L"item/largechest",
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ typedef enum _TEXTURE_NAME
|
||||
TN_MOB_SILVERFISH,
|
||||
TN_MOB_ENDERMAN_EYES,
|
||||
TN_MISC_EXPLOSION,
|
||||
TN_ITEM_EXPERIENCE_ORB,
|
||||
TN_TILE_CHEST,
|
||||
TN_TILE_LARGE_CHEST,
|
||||
|
||||
|
||||
@@ -641,11 +641,6 @@ shared_ptr<Packet> TrackedEntity::getAddEntityPacket()
|
||||
return shared_ptr<AddEntityPacket>( new AddEntityPacket(e, AddEntityPacket::THROWN_POTION, ((dynamic_pointer_cast<ThrownPotion>(e))->getPotionValue()), yRotp, xRotp, xp, yp, zp));
|
||||
}
|
||||
break;
|
||||
case eTYPE_THROWNEXPBOTTLE:
|
||||
{
|
||||
return shared_ptr<AddEntityPacket>( new AddEntityPacket(e, AddEntityPacket::THROWN_EXPBOTTLE, yRotp, xRotp, xp, yp, zp) );
|
||||
}
|
||||
break;
|
||||
case eTYPE_THROWNENDERPEARL:
|
||||
{
|
||||
return shared_ptr<AddEntityPacket>( new AddEntityPacket(e, AddEntityPacket::THROWN_ENDERPEARL, yRotp, xRotp, xp, yp, zp) );
|
||||
@@ -754,11 +749,6 @@ shared_ptr<Packet> TrackedEntity::getAddEntityPacket()
|
||||
return packet;
|
||||
}
|
||||
break;
|
||||
case eTYPE_EXPERIENCEORB:
|
||||
{
|
||||
return shared_ptr<AddExperienceOrbPacket>( new AddExperienceOrbPacket(dynamic_pointer_cast<ExperienceOrb>(e)) );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
|
||||
@@ -25,7 +25,6 @@ public:
|
||||
static const int EYEOFENDERSIGNAL = 72;
|
||||
static const int THROWN_POTION = 73;
|
||||
static const int FALLING_EGG = 74;
|
||||
static const int THROWN_EXPBOTTLE = 75;
|
||||
|
||||
static const int FISH_HOOK = 90;
|
||||
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "net.minecraft.world.entity.h"
|
||||
#include "InputOutputStream.h"
|
||||
#include "PacketListener.h"
|
||||
#include "AddExperienceOrbPacket.h"
|
||||
|
||||
|
||||
|
||||
AddExperienceOrbPacket::AddExperienceOrbPacket()
|
||||
{
|
||||
id = 0;
|
||||
x = y = z = 0;
|
||||
value = 0;
|
||||
}
|
||||
|
||||
AddExperienceOrbPacket::AddExperienceOrbPacket(shared_ptr<ExperienceOrb> e)
|
||||
{
|
||||
id = e->entityId;
|
||||
x = Mth::floor(e->x * 32);
|
||||
y = Mth::floor(e->y * 32);
|
||||
z = Mth::floor(e->z * 32);
|
||||
value = e->getValue();
|
||||
}
|
||||
|
||||
void AddExperienceOrbPacket::read(DataInputStream *dis)
|
||||
{
|
||||
id = dis->readInt();
|
||||
x = dis->readInt();
|
||||
y = dis->readInt();
|
||||
z = dis->readInt();
|
||||
value = dis->readShort();
|
||||
}
|
||||
|
||||
void AddExperienceOrbPacket::write(DataOutputStream *dos)
|
||||
{
|
||||
dos->writeInt(id);
|
||||
dos->writeInt(x);
|
||||
dos->writeInt(y);
|
||||
dos->writeInt(z);
|
||||
dos->writeShort(value);
|
||||
}
|
||||
|
||||
void AddExperienceOrbPacket::handle(PacketListener *listener)
|
||||
{
|
||||
listener->handleAddExperienceOrb(shared_from_this());
|
||||
}
|
||||
|
||||
int AddExperienceOrbPacket::getEstimatedSize()
|
||||
{
|
||||
return 18;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Packet.h"
|
||||
|
||||
class ExperienceOrb;
|
||||
|
||||
class AddExperienceOrbPacket : public Packet, public enable_shared_from_this<AddExperienceOrbPacket>
|
||||
{
|
||||
public:
|
||||
int id;
|
||||
int x, y, z;
|
||||
int value;
|
||||
|
||||
AddExperienceOrbPacket();
|
||||
AddExperienceOrbPacket(shared_ptr<ExperienceOrb> e);
|
||||
|
||||
virtual void read(DataInputStream *dis);
|
||||
virtual void write(DataOutputStream *dos);
|
||||
virtual void handle(PacketListener *listener);
|
||||
virtual int getEstimatedSize();
|
||||
|
||||
static shared_ptr<Packet> create() { return shared_ptr<Packet>(new AddExperienceOrbPacket()); }
|
||||
virtual int getId() { return 26; }
|
||||
};
|
||||
@@ -153,8 +153,6 @@ void Animal::breedWith(shared_ptr<Animal> target)
|
||||
level->addParticle(eParticleType_heart, x + random->nextFloat() * bbWidth * 2 - bbWidth, y + .5f + random->nextFloat() * bbHeight, z + random->nextFloat() * bbWidth * 2 - bbWidth, xa, ya, za);
|
||||
}
|
||||
level->addEntity(offspring);
|
||||
|
||||
level->addEntity( shared_ptr<ExperienceOrb>( new ExperienceOrb(level, x, y, z, random->nextInt(4) + 1) ) );
|
||||
}
|
||||
|
||||
setDespawnProtected();
|
||||
@@ -283,11 +281,6 @@ bool Animal::removeWhenFarAway()
|
||||
return !isDespawnProtected(); // 4J changed - was false
|
||||
}
|
||||
|
||||
int Animal::getExperienceReward(shared_ptr<Player> killedBy)
|
||||
{
|
||||
return 1 + level->random->nextInt(3);
|
||||
}
|
||||
|
||||
bool Animal::isFood(shared_ptr<ItemInstance> itemInstance)
|
||||
{
|
||||
return itemInstance->id == Item::wheat_Id;
|
||||
|
||||
@@ -48,7 +48,6 @@ public:
|
||||
|
||||
protected:
|
||||
virtual bool removeWhenFarAway();
|
||||
virtual int getExperienceReward(shared_ptr<Player> killedBy);
|
||||
|
||||
public:
|
||||
virtual bool isFood(shared_ptr<ItemInstance> itemInstance);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.phys.h"
|
||||
#include "BreedGoal.h"
|
||||
#include "ExperienceOrb.h"
|
||||
|
||||
#include "GenericStats.h"
|
||||
|
||||
@@ -111,6 +110,4 @@ void BreedGoal::breed()
|
||||
level->addParticle(eParticleType_heart, animal->x + random->nextFloat() * animal->bbWidth * 2 - animal->bbWidth, animal->y + .5f + random->nextFloat() * animal->bbHeight, animal->z + random->nextFloat()
|
||||
* animal->bbWidth * 2 - animal->bbWidth, xa, ya, za);
|
||||
}
|
||||
// 4J-PB - Fix for 106869- Customer Encountered: TU12: Content: Gameplay: Breeding animals does not give any Experience Orbs.
|
||||
level->addEntity( shared_ptr<ExperienceOrb>( new ExperienceOrb(level, animal->x, animal->y, animal->z, random->nextInt(7) + 1) ) );
|
||||
}
|
||||
@@ -71,7 +71,6 @@ enum eINSTANCEOF
|
||||
eTYPE_SMALL_FIREBALL = 0x40007,
|
||||
eTYPE_THROWNENDERPEARL = 0x40008,
|
||||
eTYPE_THROWNPOTION = 0x40009,
|
||||
eTYPE_THROWNEXPBOTTLE = 0x4000A,
|
||||
|
||||
eTYPE_ANIMALS_SPAWN_LIMIT_CHECK = 0x80000,
|
||||
|
||||
@@ -138,7 +137,6 @@ enum eINSTANCEOF
|
||||
|
||||
// 1.8.2
|
||||
eTYPE_DELAYEDRELEASE,
|
||||
eTYPE_EXPERIENCEORB,
|
||||
eType_CRITPARTICLE,
|
||||
eType_CRITPARTICLE2,
|
||||
eType_HUGEEXPLOSIONPARTICLE,
|
||||
|
||||
@@ -4,7 +4,6 @@ enum EGameCommand
|
||||
{
|
||||
eGameCommand_DefaultGameMode,
|
||||
eGameCommand_EnchantItem,
|
||||
eGameCommand_Experience,
|
||||
eGameCommand_GameMode,
|
||||
eGameCommand_Give,
|
||||
eGameCommand_Kill,
|
||||
|
||||
@@ -375,27 +375,6 @@ int DispenserTile::dispenseItem(shared_ptr<DispenserTileEntity> trap, Level *lev
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Item::expBottle_Id:
|
||||
{
|
||||
int currentProjectiles = level->countInstanceOf(eTYPE_PROJECTILE,false);
|
||||
if(currentProjectiles < Level::MAX_DISPENSABLE_PROJECTILES) // 4J - added limit
|
||||
{
|
||||
shared_ptr<ThrownExpBottle> expBottle = shared_ptr<ThrownExpBottle>( new ThrownExpBottle(level, xp, yp, zp) );
|
||||
expBottle->shoot(xd, .1f, zd, power * 1.25f, accuracy * .5f);
|
||||
level->addEntity(expBottle);
|
||||
level->levelEvent(LevelEvent::SOUND_LAUNCH, x, y, z, 0);
|
||||
return REMOVE_ITEM;
|
||||
}
|
||||
else
|
||||
{
|
||||
// some negative sound effect?
|
||||
level->levelEvent(LevelEvent::SOUND_CLICK_FAIL, x, y, z, 0);
|
||||
|
||||
// not sending a message here, since we will probably get flooded with them when people have automatic dispensers for spawn eggs
|
||||
return LEAVE_ITEM;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Item::fireball_Id: // TU9
|
||||
{
|
||||
int currentFireballs = level->countInstanceOf(eTYPE_SMALL_FIREBALL,true);
|
||||
|
||||
@@ -153,7 +153,7 @@ void EnchantmentMenu::slotsChanged() // 4J used to take a shared_ptr<Container>
|
||||
bool EnchantmentMenu::clickMenuButton(shared_ptr<Player> player, int i)
|
||||
{
|
||||
shared_ptr<ItemInstance> item = enchantSlots->getItem(0);
|
||||
if (costs[i] > 0 && item != NULL && (player->experienceLevel >= costs[i] || player->abilities.instabuild) )
|
||||
if (costs[i] > 0 && item != NULL && (player->abilities.instabuild) )
|
||||
{
|
||||
if (!level->isClientSide)
|
||||
{
|
||||
@@ -162,7 +162,6 @@ bool EnchantmentMenu::clickMenuButton(shared_ptr<Player> player, int i)
|
||||
vector<EnchantmentInstance *> *newEnchantment = EnchantmentHelper::selectEnchantment(&random, item, costs[i]);
|
||||
if (newEnchantment != NULL)
|
||||
{
|
||||
player->withdrawExperienceLevels(costs[i]);
|
||||
if (isBook) item->id = Item::enchantedBook_Id;
|
||||
int randomIndex = isBook ? random.nextInt(newEnchantment->size()) : -1;
|
||||
//for (EnchantmentInstance e : newEnchantment)
|
||||
|
||||
@@ -1186,16 +1186,6 @@ void EnderDragon::tickDeath()
|
||||
}
|
||||
if (!level->isClientSide)
|
||||
{
|
||||
if (dragonDeathTime > 150 && dragonDeathTime % 5 == 0)
|
||||
{
|
||||
int xpCount = 1000;
|
||||
while (xpCount > 0)
|
||||
{
|
||||
int newCount = ExperienceOrb::getExperienceValue(xpCount);
|
||||
xpCount -= newCount;
|
||||
level->addEntity(shared_ptr<ExperienceOrb>( new ExperienceOrb(level, x, y, z, newCount) ));
|
||||
}
|
||||
}
|
||||
if (dragonDeathTime == 1)
|
||||
{
|
||||
//level->globalLevelEvent(LevelEvent::SOUND_DRAGON_DEATH, (int) x, (int) y, (int) z, 0);
|
||||
@@ -1209,13 +1199,6 @@ void EnderDragon::tickDeath()
|
||||
{
|
||||
//level->levelEvent(NULL, LevelEvent::ENDERDRAGON_KILLED, (int) x, (int) y, (int) z, 0);
|
||||
|
||||
int xpCount = 2000;
|
||||
while (xpCount > 0)
|
||||
{
|
||||
int newCount = ExperienceOrb::getExperienceValue(xpCount);
|
||||
xpCount -= newCount;
|
||||
level->addEntity(shared_ptr<ExperienceOrb>( new ExperienceOrb(level, x, y, z, newCount)));
|
||||
}
|
||||
int xo = 5 + random->nextInt(2) * 2 - 1;
|
||||
int zo = 5 + random->nextInt(2) * 2 - 1;
|
||||
if (random->nextInt(2) == 0)
|
||||
|
||||
@@ -42,7 +42,6 @@ void EntityIO::setId(entityCreateFn createFn, eINSTANCEOF clas, const wstring &i
|
||||
void EntityIO::staticCtor()
|
||||
{
|
||||
setId(ItemEntity::create, eTYPE_ITEMENTITY, L"Item", 1);
|
||||
setId(ExperienceOrb::create, eTYPE_EXPERIENCEORB, L"XPOrb", 2);
|
||||
|
||||
setId(Painting::create, eTYPE_PAINTING, L"Painting", 9);
|
||||
setId(Arrow::create, eTYPE_ARROW, L"Arrow", 10);
|
||||
@@ -52,7 +51,6 @@ void EntityIO::staticCtor()
|
||||
setId(ThrownEnderpearl::create, eTYPE_THROWNENDERPEARL, L"ThrownEnderpearl", 14);
|
||||
setId(EyeOfEnderSignal::create, eTYPE_EYEOFENDERSIGNAL, L"EyeOfEnderSignal", 15);
|
||||
setId(ThrownPotion::create, eTYPE_THROWNPOTION, L"ThrownPotion", 16);
|
||||
setId(ThrownExpBottle::create, eTYPE_THROWNEXPBOTTLE, L"ThrownExpBottle", 17);
|
||||
setId(ItemFrame::create, eTYPE_ITEM_FRAME, L"ItemFrame", 18);
|
||||
|
||||
setId(PrimedTnt::create, eTYPE_PRIMEDTNT, L"PrimedTnt", 20);
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "net.minecraft.commands.h"
|
||||
#include "..\Minecraft.Client\MinecraftServer.h"
|
||||
#include "..\Minecraft.Client\PlayerList.h"
|
||||
#include "ExperienceCommand.h"
|
||||
|
||||
EGameCommand ExperienceCommand::getId()
|
||||
{
|
||||
return eGameCommand_Experience;
|
||||
}
|
||||
|
||||
void ExperienceCommand::execute(shared_ptr<CommandSender> source, byteArray commandData)
|
||||
{
|
||||
//if (args.length > 0)
|
||||
//{
|
||||
// Player player;
|
||||
// int amount = convertArgToInt(source, args[0], 0, 5000);
|
||||
|
||||
// if (args.length > 1) {
|
||||
// player = getPlayer(args[1]);
|
||||
// } else {
|
||||
// player = convertSourceToPlayer(source);
|
||||
// }
|
||||
|
||||
// player.increaseXp(amount);
|
||||
// logAdminAction(source, "commands.xp.success", amount, player.getAName());
|
||||
//}
|
||||
}
|
||||
|
||||
shared_ptr<Player> ExperienceCommand::getPlayer(PlayerUID playerId)
|
||||
{
|
||||
return nullptr;
|
||||
//shared_ptr<Player> player = MinecraftServer::getInstance()->getPlayers()->getPlayer(playerId);
|
||||
|
||||
//if (player == null)
|
||||
//{
|
||||
// throw new PlayerNotFoundException();
|
||||
//} else {
|
||||
// return player;
|
||||
//}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Command.h"
|
||||
|
||||
class CommandSender;
|
||||
|
||||
class ExperienceCommand : public Command
|
||||
{
|
||||
public:
|
||||
virtual EGameCommand getId();
|
||||
virtual void execute(shared_ptr<CommandSender> source, byteArray commandData);
|
||||
|
||||
protected:
|
||||
shared_ptr<Player> getPlayer(PlayerUID playerId);
|
||||
};
|
||||
@@ -1,32 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.entity.projectile.h"
|
||||
#include "net.minecraft.world.entity.player.h"
|
||||
#include "net.minecraft.world.item.h"
|
||||
#include "SoundTypes.h"
|
||||
#include "ExperienceItem.h"
|
||||
|
||||
ExperienceItem::ExperienceItem(int id) : Item(id)
|
||||
{
|
||||
}
|
||||
|
||||
bool ExperienceItem::isFoil(shared_ptr<ItemInstance> itemInstance)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ExperienceItem::TestUse(Level *level, shared_ptr<Player> player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
shared_ptr<ItemInstance> ExperienceItem::use(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player)
|
||||
{
|
||||
if (!player->abilities.instabuild)
|
||||
{
|
||||
itemInstance->count--;
|
||||
}
|
||||
level->playSound(player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f));
|
||||
if (!level->isClientSide) level->addEntity( shared_ptr<ThrownExpBottle>( new ThrownExpBottle(level, player) ));
|
||||
return itemInstance;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Item.h"
|
||||
|
||||
class ItemInstance;
|
||||
|
||||
class ExperienceItem : public Item
|
||||
{
|
||||
public:
|
||||
ExperienceItem(int id);
|
||||
|
||||
virtual bool isFoil(shared_ptr<ItemInstance> itemInstance);
|
||||
virtual shared_ptr<ItemInstance> use(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player);
|
||||
virtual bool TestUse(Level *level, shared_ptr<Player> player);
|
||||
};
|
||||
@@ -1,330 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.level.material.h"
|
||||
#include "net.minecraft.world.phys.h"
|
||||
#include "net.minecraft.world.level.tile.h"
|
||||
#include "net.minecraft.world.damagesource.h"
|
||||
#include "com.mojang.nbt.h"
|
||||
#include "JavaMath.h"
|
||||
#include "SharedConstants.h"
|
||||
#include "ExperienceOrb.h"
|
||||
#include "SoundTypes.h"
|
||||
|
||||
|
||||
|
||||
const int ExperienceOrb::LIFETIME = 5 * 60 * SharedConstants::TICKS_PER_SECOND; // Five minutes!
|
||||
|
||||
void ExperienceOrb::_init()
|
||||
{
|
||||
tickCount = 0;
|
||||
age = 0;
|
||||
|
||||
throwTime = 0;
|
||||
|
||||
health = 5;
|
||||
value = 0;
|
||||
followingPlayer = nullptr;
|
||||
followingTime = 0;
|
||||
}
|
||||
|
||||
ExperienceOrb::ExperienceOrb(Level *level, double x, double y, double z, int count) : Entity(level)
|
||||
{
|
||||
_init();
|
||||
|
||||
setSize(0.5f, 0.5f);
|
||||
heightOffset = bbHeight / 2.0f;
|
||||
setPos(x, y, z);
|
||||
|
||||
yRot = (float) (Math::random() * 360);
|
||||
|
||||
xd = (float) (Math::random() * 0.2f - 0.1f) * 2;
|
||||
yd = (float) (Math::random() * 0.2) * 2;
|
||||
zd = (float) (Math::random() * 0.2f - 0.1f) * 2;
|
||||
|
||||
value = count;
|
||||
}
|
||||
|
||||
bool ExperienceOrb::makeStepSound()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ExperienceOrb::ExperienceOrb(Level *level) : Entity( level )
|
||||
{
|
||||
_init();
|
||||
|
||||
setSize(0.25f, 0.25f);
|
||||
heightOffset = bbHeight / 2.0f;
|
||||
}
|
||||
|
||||
void ExperienceOrb::defineSynchedData()
|
||||
{
|
||||
}
|
||||
|
||||
int ExperienceOrb::getLightColor(float a)
|
||||
{
|
||||
float l = 0.5f;
|
||||
if (l < 0) l = 0;
|
||||
if (l > 1) l = 1;
|
||||
int br = Entity::getLightColor(a);
|
||||
|
||||
int br1 = (br) & 0xff;
|
||||
int br2 = (br >> 16) & 0xff;
|
||||
br1 += (int) (l * 15 * 16);
|
||||
if (br1 > 15 * 16) br1 = 15 * 16;
|
||||
// br2 = 15*16;
|
||||
return br1 | br2 << 16;
|
||||
}
|
||||
|
||||
void ExperienceOrb::tick()
|
||||
{
|
||||
Entity::tick();
|
||||
if (throwTime > 0) throwTime--;
|
||||
xo = x;
|
||||
yo = y;
|
||||
zo = z;
|
||||
|
||||
yd -= 0.03f;
|
||||
if (level->getMaterial(Mth::floor(x), Mth::floor(y), Mth::floor(z)) == Material::lava)
|
||||
{
|
||||
yd = 0.2f;
|
||||
xd = (random->nextFloat() - random->nextFloat()) * 0.2f;
|
||||
zd = (random->nextFloat() - random->nextFloat()) * 0.2f;
|
||||
level->playSound(shared_from_this(), eSoundType_RANDOM_FIZZ, 0.4f, 2.0f + random->nextFloat() * 0.4f);
|
||||
}
|
||||
checkInTile(x, (bb->y0 + bb->y1) / 2, z);
|
||||
|
||||
double maxDist = 8;
|
||||
// 4J - PC Comment
|
||||
// Usually exp orbs will get created at the same time so smoothen the lagspikes
|
||||
if (followingTime < tickCount - SharedConstants::TICKS_PER_SECOND + (entityId % 100))
|
||||
{
|
||||
if (followingPlayer == NULL || followingPlayer->distanceToSqr(shared_from_this()) > maxDist * maxDist)
|
||||
{
|
||||
followingPlayer = level->getNearestPlayer(shared_from_this(), maxDist);
|
||||
}
|
||||
followingTime = tickCount;
|
||||
}
|
||||
if (followingPlayer != NULL)
|
||||
{
|
||||
double xdd = (followingPlayer->x - x) / maxDist;
|
||||
double ydd = (followingPlayer->y + followingPlayer->getHeadHeight() - y) / maxDist;
|
||||
double zdd = (followingPlayer->z - z) / maxDist;
|
||||
double dd = sqrt(xdd * xdd + ydd * ydd + zdd * zdd);
|
||||
double power = 1 - dd;
|
||||
if (power > 0)
|
||||
{
|
||||
power = power * power;
|
||||
xd += xdd / dd * power * 0.1;
|
||||
yd += ydd / dd * power * 0.1;
|
||||
zd += zdd / dd * power * 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
move(xd, yd, zd);
|
||||
|
||||
float friction = 0.98f;
|
||||
if (onGround)
|
||||
{
|
||||
friction = 0.6f * 0.98f;
|
||||
int t = level->getTile(Mth::floor(x), Mth::floor(bb->y0) - 1, Mth::floor(z));
|
||||
if (t > 0)
|
||||
{
|
||||
friction = Tile::tiles[t]->friction * 0.98f;
|
||||
}
|
||||
}
|
||||
|
||||
xd *= friction;
|
||||
yd *= 0.98f;
|
||||
zd *= friction;
|
||||
|
||||
if (onGround)
|
||||
{
|
||||
yd *= -0.9f;
|
||||
}
|
||||
|
||||
tickCount++;
|
||||
|
||||
age++;
|
||||
if (age >= LIFETIME)
|
||||
{
|
||||
remove();
|
||||
}
|
||||
}
|
||||
|
||||
bool ExperienceOrb::updateInWaterState()
|
||||
{
|
||||
return level->checkAndHandleWater(bb, Material::water, shared_from_this());
|
||||
}
|
||||
|
||||
void ExperienceOrb::burn(int dmg)
|
||||
{
|
||||
hurt(DamageSource::inFire, dmg);
|
||||
}
|
||||
|
||||
bool ExperienceOrb::hurt(DamageSource *source, int damage)
|
||||
{
|
||||
markHurt();
|
||||
health -= damage;
|
||||
if (health <= 0)
|
||||
{
|
||||
remove();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ExperienceOrb::addAdditonalSaveData(CompoundTag *entityTag)
|
||||
{
|
||||
entityTag->putShort(L"Health", (byte) health);
|
||||
entityTag->putShort(L"Age", (short) age);
|
||||
entityTag->putShort(L"Value", (short) value);
|
||||
}
|
||||
|
||||
void ExperienceOrb::readAdditionalSaveData(CompoundTag *tag)
|
||||
{
|
||||
health = tag->getShort(L"Health") & 0xff;
|
||||
age = tag->getShort(L"Age");
|
||||
value = tag->getShort(L"Value");
|
||||
}
|
||||
|
||||
void ExperienceOrb::playerTouch(shared_ptr<Player> player)
|
||||
{
|
||||
if (level->isClientSide) return;
|
||||
|
||||
if (throwTime == 0 && player->takeXpDelay == 0)
|
||||
{
|
||||
player->takeXpDelay = 2;
|
||||
// 4J - sound change brought forward from 1.2.3
|
||||
level->playSound(shared_from_this(), eSoundType_RANDOM_ORB, 0.1f, 0.5f * ((random->nextFloat() - random->nextFloat()) * 0.7f + 1.8f));
|
||||
player->take(shared_from_this(), 1);
|
||||
player->increaseXp(value);
|
||||
remove();
|
||||
}
|
||||
}
|
||||
|
||||
int ExperienceOrb::getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
int ExperienceOrb::getIcon()
|
||||
{
|
||||
|
||||
if (value >= 2477)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (value >= 1237)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (value >= 617)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (value >= 307)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (value >= 149)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (value >= 73)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (value >= 37)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
else if (value >= 17)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if (value >= 7)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (value >= 3)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the biggest possible experience orb value based on a maximum
|
||||
* value. The current algorithm is next prime which is at least twice more
|
||||
* than the previous one.
|
||||
*
|
||||
* @param maxValue
|
||||
* @return
|
||||
*/
|
||||
int ExperienceOrb::getExperienceValue(int maxValue)
|
||||
{
|
||||
|
||||
if (maxValue >= 2477)
|
||||
{
|
||||
return 2477;
|
||||
}
|
||||
else if (maxValue >= 1237)
|
||||
{
|
||||
return 1237;
|
||||
}
|
||||
else if (maxValue >= 617)
|
||||
{
|
||||
return 617;
|
||||
}
|
||||
else if (maxValue >= 307)
|
||||
{
|
||||
return 307;
|
||||
}
|
||||
else if (maxValue >= 149)
|
||||
{
|
||||
return 149;
|
||||
}
|
||||
else if (maxValue >= 73)
|
||||
{
|
||||
return 73;
|
||||
}
|
||||
else if (maxValue >= 37)
|
||||
{
|
||||
return 37;
|
||||
}
|
||||
else if (maxValue >= 17)
|
||||
{
|
||||
return 17;
|
||||
}
|
||||
else if (maxValue >= 7)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (maxValue >= 3)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool ExperienceOrb::isAttackable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 4J added
|
||||
bool ExperienceOrb::shouldRender(Vec3 *c)
|
||||
{
|
||||
double xd = x - c->x;
|
||||
double yd = y - c->y;
|
||||
double zd = z - c->z;
|
||||
double distance = xd * xd + yd * yd + zd * zd;
|
||||
|
||||
// 4J - don't render experience orbs that are less than 2 metres away, to try and avoid large particles that are causing us problems with photosensitivity testing - issues when you go
|
||||
// near a large pile of experience orbs that all rush towards the near clip plane
|
||||
if( distance < 4 ) return false;
|
||||
|
||||
return Entity::shouldRender(c);
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
class ExperienceOrb : public Entity
|
||||
{
|
||||
public:
|
||||
virtual eINSTANCEOF GetType() { return eTYPE_EXPERIENCEORB; }
|
||||
//virtual eINSTANCEOF GetType() { return eTYPE_EXPERIENCEORB; }
|
||||
static Entity *create(Level *level) { return new ExperienceOrb(level); }
|
||||
|
||||
private:
|
||||
|
||||
@@ -432,7 +432,6 @@ int FishingHook::retrieve()
|
||||
ie->Entity::yd = ya * speed + sqrt(dist) * 0.08;
|
||||
ie->Entity::zd = za * speed;
|
||||
level->addEntity(ie);
|
||||
owner->level->addEntity( shared_ptr<ExperienceOrb>( new ExperienceOrb(owner->level, owner->x, owner->y + 0.5f, owner->z + 0.5f, random->nextInt(3) + 1) ) ); // 4J Stu brought forward from 1.4
|
||||
dmg = 1;
|
||||
}
|
||||
if (inGround) dmg = 2;
|
||||
|
||||
@@ -68,13 +68,6 @@ void FurnaceResultSlot::checkTakeAchievements(shared_ptr<ItemInstance> carried)
|
||||
}
|
||||
amount = baseValue;
|
||||
}
|
||||
|
||||
while (amount > 0)
|
||||
{
|
||||
int newCount = ExperienceOrb::getExperienceValue(amount);
|
||||
amount -= newCount;
|
||||
player->level->addEntity(shared_ptr<ExperienceOrb>( new ExperienceOrb(player->level, player->x, player->y + .5, player->z + .5, newCount) ));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _DURANGO
|
||||
|
||||
@@ -202,8 +202,6 @@ Item *Item::speckledMelon = NULL;
|
||||
|
||||
Item *Item::monsterPlacer = NULL;
|
||||
|
||||
Item *Item::expBottle = NULL;
|
||||
|
||||
// TU9
|
||||
Item *Item::fireball = NULL;
|
||||
Item *Item::frame = NULL;
|
||||
@@ -417,9 +415,6 @@ void Item::staticCtor()
|
||||
|
||||
Item::monsterPlacer = (new MonsterPlacerItem(127)) ->setTextureName(L"monsterPlacer")->setDescriptionId(IDS_ITEM_MONSTER_SPAWNER)->setUseDescriptionId(IDS_DESC_MONSTER_SPAWNER);
|
||||
|
||||
// 4J Stu - Brought this forward
|
||||
Item::expBottle = (new ExperienceItem(128)) ->setTextureName(L"expBottle")->setDescriptionId(IDS_ITEM_EXP_BOTTLE)->setUseDescriptionId(IDS_DESC_EXP_BOTTLE);
|
||||
|
||||
Item::record_01 = ( new RecordingItem(2000, L"13") ) ->setTextureName(L"record")->setDescriptionId(IDS_ITEM_RECORD_01)->setUseDescriptionId(IDS_DESC_RECORD);
|
||||
Item::record_02 = ( new RecordingItem(2001, L"cat") ) ->setTextureName(L"record")->setDescriptionId(IDS_ITEM_RECORD_02)->setUseDescriptionId(IDS_DESC_RECORD);
|
||||
|
||||
@@ -1079,7 +1074,6 @@ const int Item::cauldron_Id ;
|
||||
const int Item::eyeOfEnder_Id ;
|
||||
const int Item::speckledMelon_Id ;
|
||||
const int Item::monsterPlacer_Id ;
|
||||
const int Item::expBottle_Id ;
|
||||
const int Item::skull_Id ;
|
||||
const int Item::record_01_Id ;
|
||||
const int Item::record_02_Id ;
|
||||
|
||||
@@ -342,8 +342,6 @@ public:
|
||||
|
||||
static Item *monsterPlacer;
|
||||
|
||||
static Item *expBottle;
|
||||
|
||||
static Item *skull;
|
||||
|
||||
static Item *record_01;
|
||||
@@ -529,8 +527,6 @@ public:
|
||||
// 1.1
|
||||
static const int monsterPlacer_Id = 383;
|
||||
|
||||
static const int expBottle_Id = 384;
|
||||
|
||||
// TU 12
|
||||
static const int skull_Id = 397;
|
||||
|
||||
|
||||
@@ -1781,7 +1781,6 @@
|
||||
<ClInclude Include="Achievement.h" />
|
||||
<ClInclude Include="Achievements.h" />
|
||||
<ClInclude Include="AddEntityPacket.h" />
|
||||
<ClInclude Include="AddExperienceOrbPacket.h" />
|
||||
<ClInclude Include="AddGlobalEntityPacket.h" />
|
||||
<ClInclude Include="AddIslandLayer.h" />
|
||||
<ClInclude Include="AddMobPacket.h" />
|
||||
@@ -1998,8 +1997,6 @@
|
||||
<ClInclude Include="EnderEyeItem.h" />
|
||||
<ClInclude Include="EnderpearlItem.h" />
|
||||
<ClInclude Include="EndPodiumFeature.h" />
|
||||
<ClInclude Include="ExperienceCommand.h" />
|
||||
<ClInclude Include="ExperienceItem.h" />
|
||||
<ClInclude Include="EyeOfEnderSignal.h" />
|
||||
<ClInclude Include="FireAspectEnchantment.h" />
|
||||
<ClInclude Include="FireChargeItem.h" />
|
||||
@@ -2188,7 +2185,6 @@
|
||||
<ClInclude Include="TheEndPortalTileEntity.h" />
|
||||
<ClInclude Include="Throwable.h" />
|
||||
<ClInclude Include="ThrownEnderpearl.h" />
|
||||
<ClInclude Include="ThrownExpBottle.h" />
|
||||
<ClInclude Include="ThrownPotion.h" />
|
||||
<ClInclude Include="TileEntityDataPacket.h" />
|
||||
<ClInclude Include="UntouchingEnchantment.h" />
|
||||
@@ -2197,7 +2193,6 @@
|
||||
<ClInclude Include="DownfallMixerLayer.h" />
|
||||
<ClInclude Include="EnderMan.h" />
|
||||
<ClInclude Include="EntityDamageSource.h" />
|
||||
<ClInclude Include="ExperienceOrb.h" />
|
||||
<ClInclude Include="ExtremeHillsBiome.h" />
|
||||
<ClInclude Include="FenceGateTile.h" />
|
||||
<ClInclude Include="FlatLayer.h" />
|
||||
@@ -2573,7 +2568,6 @@
|
||||
<ClInclude Include="Scale.h" />
|
||||
<ClInclude Include="SeedItem.h" />
|
||||
<ClInclude Include="SetCreativeModeSlotPacket.h" />
|
||||
<ClInclude Include="SetExperiencePacket.h" />
|
||||
<ClInclude Include="ShapedRecipy.h" />
|
||||
<ClInclude Include="ShapelessRecipy.h" />
|
||||
<ClInclude Include="SetCarriedItemPacket.h" />
|
||||
@@ -2710,7 +2704,6 @@
|
||||
<ClCompile Include="Achievement.cpp" />
|
||||
<ClCompile Include="Achievements.cpp" />
|
||||
<ClCompile Include="AddEntityPacket.cpp" />
|
||||
<ClCompile Include="AddExperienceOrbPacket.cpp" />
|
||||
<ClCompile Include="AddGlobalEntityPacket.cpp" />
|
||||
<ClCompile Include="AddIslandLayer.cpp" />
|
||||
<ClCompile Include="AddMobPacket.cpp" />
|
||||
@@ -2931,7 +2924,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="EnchantItemCommand.cpp" />
|
||||
<ClCompile Include="ExperienceCommand.cpp" />
|
||||
<ClCompile Include="GameCommandPacket.cpp" />
|
||||
<ClCompile Include="GameModeCommand.cpp" />
|
||||
<ClCompile Include="GenericStats.cpp" />
|
||||
@@ -2993,7 +2985,6 @@
|
||||
<ClCompile Include="EnderEyeItem.cpp" />
|
||||
<ClCompile Include="EnderpearlItem.cpp" />
|
||||
<ClCompile Include="EndPodiumFeature.cpp" />
|
||||
<ClCompile Include="ExperienceItem.cpp" />
|
||||
<ClCompile Include="ExtremeHillsBiome.cpp" />
|
||||
<ClCompile Include="Feature.cpp" />
|
||||
<ClCompile Include="EnderCrystal.cpp" />
|
||||
@@ -3154,7 +3145,6 @@
|
||||
<ClCompile Include="TheEndPortalTileEntity.cpp" />
|
||||
<ClCompile Include="Throwable.cpp" />
|
||||
<ClCompile Include="ThrownEnderpearl.cpp" />
|
||||
<ClCompile Include="ThrownExpBottle.cpp" />
|
||||
<ClCompile Include="ThrownPotion.cpp" />
|
||||
<ClCompile Include="TileEntityDataPacket.cpp" />
|
||||
<ClCompile Include="UntouchingEnchantment.cpp" />
|
||||
@@ -3178,7 +3168,6 @@
|
||||
<ClCompile Include="EntityIO.cpp" />
|
||||
<ClCompile Include="EntityPos.cpp" />
|
||||
<ClCompile Include="EntityTile.cpp" />
|
||||
<ClCompile Include="ExperienceOrb.cpp" />
|
||||
<ClCompile Include="ExplodePacket.cpp" />
|
||||
<ClCompile Include="Explosion.cpp" />
|
||||
<ClCompile Include="Facing.cpp" />
|
||||
@@ -3588,7 +3577,6 @@
|
||||
<ClCompile Include="SetEntityDataPacket.cpp" />
|
||||
<ClCompile Include="SetEntityMotionPacket.cpp" />
|
||||
<ClCompile Include="SetEquippedItemPacket.cpp" />
|
||||
<ClCompile Include="SetExperiencePacket.cpp" />
|
||||
<ClCompile Include="SetHealthPacket.cpp" />
|
||||
<ClCompile Include="SetRidingPacket.cpp" />
|
||||
<ClCompile Include="SetSpawnPositionPacket.cpp" />
|
||||
|
||||
@@ -1747,9 +1747,6 @@
|
||||
<ClInclude Include="StrongholdFeature.h">
|
||||
<Filter>net\minecraft\world\level\levelgen\structure</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="AddExperienceOrbPacket.h">
|
||||
<Filter>net\minecraft\network\packet</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GetInfoPacket.h">
|
||||
<Filter>net\minecraft\network\packet</Filter>
|
||||
</ClInclude>
|
||||
@@ -1762,9 +1759,6 @@
|
||||
<ClInclude Include="SetCreativeModeSlotPacket.h">
|
||||
<Filter>net\minecraft\network\packet</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SetExperiencePacket.h">
|
||||
<Filter>net\minecraft\network\packet</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="UpdateMobEffectPacket.h">
|
||||
<Filter>net\minecraft\network\packet</Filter>
|
||||
</ClInclude>
|
||||
@@ -1804,9 +1798,6 @@
|
||||
<ClInclude Include="DelayedRelease.h">
|
||||
<Filter>net\minecraft\world\entity</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ExperienceOrb.h">
|
||||
<Filter>net\minecraft\world\entity</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="net.minecraft.world.food.h">
|
||||
<Filter>net\minecraft\world\food</Filter>
|
||||
</ClInclude>
|
||||
@@ -2176,9 +2167,6 @@
|
||||
<ClInclude Include="GrowMushroomIslandLayer.h">
|
||||
<Filter>net\minecraft\world\level\newbiome\layer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ThrownExpBottle.h">
|
||||
<Filter>net\minecraft\world\entity\projectile</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ArrowDamageEnchantment.h">
|
||||
<Filter>net\minecraft\world\item\enchantment</Filter>
|
||||
</ClInclude>
|
||||
@@ -2191,9 +2179,6 @@
|
||||
<ClInclude Include="ArrowKnockbackEnchantment.h">
|
||||
<Filter>net\minecraft\world\item\enchantment</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ExperienceItem.h">
|
||||
<Filter>net\minecraft\world\item</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="TileEntityDataPacket.h">
|
||||
<Filter>net\minecraft\network\packet</Filter>
|
||||
</ClInclude>
|
||||
@@ -2728,9 +2713,6 @@
|
||||
<ClInclude Include="net.minecraft.commands.common.h">
|
||||
<Filter>net\minecraft\commands\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ExperienceCommand.h">
|
||||
<Filter>net\minecraft\commands\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GameModeCommand.h">
|
||||
<Filter>net\minecraft\commands\common</Filter>
|
||||
</ClInclude>
|
||||
@@ -4026,9 +4008,6 @@
|
||||
<ClCompile Include="StrongholdFeature.cpp">
|
||||
<Filter>net\minecraft\world\level\levelgen\structure</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AddExperienceOrbPacket.cpp">
|
||||
<Filter>net\minecraft\network\packet</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GetInfoPacket.cpp">
|
||||
<Filter>net\minecraft\network\packet</Filter>
|
||||
</ClCompile>
|
||||
@@ -4041,9 +4020,6 @@
|
||||
<ClCompile Include="SetCreativeModeSlotPacket.cpp">
|
||||
<Filter>net\minecraft\network\packet</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SetExperiencePacket.cpp">
|
||||
<Filter>net\minecraft\network\packet</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="UpdateMobEffectPacket.cpp">
|
||||
<Filter>net\minecraft\network\packet</Filter>
|
||||
</ClCompile>
|
||||
@@ -4077,9 +4053,6 @@
|
||||
<ClCompile Include="DelayedRelease.cpp">
|
||||
<Filter>net\minecraft\world\entity</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ExperienceOrb.cpp">
|
||||
<Filter>net\minecraft\world\entity</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="FoodConstants.cpp">
|
||||
<Filter>net\minecraft\world\food</Filter>
|
||||
</ClCompile>
|
||||
@@ -4419,9 +4392,6 @@
|
||||
<ClCompile Include="GrowMushroomIslandLayer.cpp">
|
||||
<Filter>net\minecraft\world\level\newbiome\layer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ThrownExpBottle.cpp">
|
||||
<Filter>net\minecraft\world\entity\projectile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ArrowDamageEnchantment.cpp">
|
||||
<Filter>net\minecraft\world\item\enchantment</Filter>
|
||||
</ClCompile>
|
||||
@@ -4434,9 +4404,6 @@
|
||||
<ClCompile Include="ArrowKnockbackEnchantment.cpp">
|
||||
<Filter>net\minecraft\world\item\enchantment</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ExperienceItem.cpp">
|
||||
<Filter>net\minecraft\world\item</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TileEntityDataPacket.cpp">
|
||||
<Filter>net\minecraft\network\packet</Filter>
|
||||
</ClCompile>
|
||||
@@ -4878,9 +4845,6 @@
|
||||
<ClCompile Include="DefaultGameModeCommand.cpp">
|
||||
<Filter>net\minecraft\commands\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ExperienceCommand.cpp">
|
||||
<Filter>net\minecraft\commands\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GameModeCommand.cpp">
|
||||
<Filter>net\minecraft\commands\common</Filter>
|
||||
</ClCompile>
|
||||
|
||||
@@ -444,21 +444,6 @@ void Mob::tickDeath()
|
||||
deathTime++;
|
||||
if (deathTime == 20)
|
||||
{
|
||||
// 4J Stu - Added level->isClientSide check from 1.2 to fix XP orbs being created client side
|
||||
if(!level->isClientSide && (lastHurtByPlayerTime > 0 || isAlwaysExperienceDropper()) )
|
||||
{
|
||||
if (!isBaby())
|
||||
{
|
||||
int xpCount = this->getExperienceReward(lastHurtByPlayer);
|
||||
while (xpCount > 0)
|
||||
{
|
||||
int newCount = ExperienceOrb::getExperienceValue(xpCount);
|
||||
xpCount -= newCount;
|
||||
level->addEntity(shared_ptr<ExperienceOrb>( new ExperienceOrb(level, x, y, z, newCount) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
remove();
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
@@ -475,16 +460,6 @@ int Mob::decreaseAirSupply(int currentSupply)
|
||||
return currentSupply - 1;
|
||||
}
|
||||
|
||||
int Mob::getExperienceReward(shared_ptr<Player> killedBy)
|
||||
{
|
||||
return xpReward;
|
||||
}
|
||||
|
||||
bool Mob::isAlwaysExperienceDropper()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Mob::spawnAnim()
|
||||
{
|
||||
for (int i = 0; i < 20; i++)
|
||||
|
||||
@@ -183,8 +183,6 @@ public:
|
||||
protected:
|
||||
virtual void tickDeath();
|
||||
virtual int decreaseAirSupply(int currentSupply);
|
||||
virtual int getExperienceReward(shared_ptr<Player> killedBy);
|
||||
virtual bool isAlwaysExperienceDropper();
|
||||
|
||||
public:
|
||||
void spawnAnim();
|
||||
|
||||
@@ -35,12 +35,6 @@ bool MobSpawnerTile::blocksLight()
|
||||
void MobSpawnerTile::spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel)
|
||||
{
|
||||
Tile::spawnResources(level, x, y, z, data, odds, playerBonusLevel);
|
||||
|
||||
// also spawn experience if the block is broken
|
||||
{
|
||||
int magicCount = 15 + level->random->nextInt(15) + level->random->nextInt(15);
|
||||
popExperience(level, x, y, z, magicCount);
|
||||
}
|
||||
}
|
||||
|
||||
int MobSpawnerTile::cloneTileId(Level *level, int x, int y, int z)
|
||||
|
||||
@@ -40,33 +40,6 @@ int OreTile::getResourceCountForLootBonus(int bonusLevel, Random *random)
|
||||
void OreTile::spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel)
|
||||
{
|
||||
Tile::spawnResources(level, x, y, z, data, odds, playerBonusLevel);
|
||||
|
||||
// also spawn experience if the block is broken
|
||||
if (getResource(data, level->random, playerBonusLevel) != id)
|
||||
{
|
||||
int magicCount = 0;
|
||||
if (id == Tile::coalOre_Id)
|
||||
{
|
||||
magicCount = Mth::nextInt(level->random, 0, 2);
|
||||
}
|
||||
else if (id == Tile::diamondOre_Id)
|
||||
{
|
||||
magicCount = Mth::nextInt(level->random, 3, 7);
|
||||
}
|
||||
else if (id == Tile::emeraldOre_Id)
|
||||
{
|
||||
magicCount = Mth::nextInt(level->random, 3, 7);
|
||||
}
|
||||
else if (id == Tile::lapisOre_Id)
|
||||
{
|
||||
magicCount = Mth::nextInt(level->random, 2, 5);
|
||||
}
|
||||
else if (id == Tile::netherQuartz_Id)
|
||||
{
|
||||
magicCount = Mth::nextInt(level->random, 2, 5);
|
||||
}
|
||||
popExperience(level, x, y, z, magicCount);
|
||||
}
|
||||
}
|
||||
|
||||
int OreTile::getSpawnResourcesAuxValue(int data)
|
||||
|
||||
@@ -51,7 +51,6 @@ void Packet::staticCtor()
|
||||
map(23, true, false, false, true, typeid(AddEntityPacket), AddEntityPacket::create);
|
||||
map(24, true, false, false, true, typeid(AddMobPacket), AddMobPacket::create);
|
||||
map(25, true, false, false, false, typeid(AddPaintingPacket), AddPaintingPacket::create);
|
||||
map(26, true, false, false, false, typeid(AddExperienceOrbPacket), AddExperienceOrbPacket::create); // TODO New for 1.8.2 - Needs sendToAny?
|
||||
//map(27, false, true, false, false, PlayerInputPacket));
|
||||
// 4J-PB - needs to go to any player, due to the knockback effect when a played is hit
|
||||
map(28, true, false, true, true, typeid(SetEntityMotionPacket), SetEntityMotionPacket::create);
|
||||
@@ -70,7 +69,6 @@ void Packet::staticCtor()
|
||||
map(40, true, false, true, true, typeid(SetEntityDataPacket), SetEntityDataPacket::create);
|
||||
map(41, true, false, true, false, typeid(UpdateMobEffectPacket), UpdateMobEffectPacket::create);
|
||||
map(42, true, false, true, false, typeid(RemoveMobEffectPacket), RemoveMobEffectPacket::create);
|
||||
map(43, true, false, true, false, typeid(SetExperiencePacket), SetExperiencePacket::create);
|
||||
|
||||
map(50, true, false, true, true, typeid(ChunkVisibilityPacket), ChunkVisibilityPacket::create);
|
||||
map(51, true, false, true, true, typeid(BlockRegionUpdatePacket), BlockRegionUpdatePacket::create); // Changed to LevelChunkPacket in Java but we aren't using that
|
||||
|
||||
@@ -295,21 +295,11 @@ void PacketListener::handleKeepAlive(shared_ptr<KeepAlivePacket> packet)
|
||||
onUnhandledPacket(packet);
|
||||
}
|
||||
|
||||
void PacketListener::handleSetExperience(shared_ptr<SetExperiencePacket> packet)
|
||||
{
|
||||
onUnhandledPacket(packet);
|
||||
}
|
||||
|
||||
void PacketListener::handleSetCreativeModeSlot(shared_ptr<SetCreativeModeSlotPacket> packet)
|
||||
{
|
||||
onUnhandledPacket(packet);
|
||||
}
|
||||
|
||||
void PacketListener::handleAddExperienceOrb(shared_ptr<AddExperienceOrbPacket> packet)
|
||||
{
|
||||
onUnhandledPacket(packet);
|
||||
}
|
||||
|
||||
// 1.0.1
|
||||
void PacketListener::handleContainerButtonClick(shared_ptr<ContainerButtonClickPacket> packet)
|
||||
{
|
||||
|
||||
@@ -60,9 +60,7 @@ class GetInfoPacket;
|
||||
class UpdateMobEffectPacket;
|
||||
class RemoveMobEffectPacket;
|
||||
class PlayerInfoPacket;
|
||||
class SetExperiencePacket;
|
||||
class SetCreativeModeSlotPacket;
|
||||
class AddExperienceOrbPacket;
|
||||
|
||||
// 1.0.1
|
||||
class ContainerButtonClickPacket;
|
||||
@@ -166,9 +164,7 @@ public:
|
||||
virtual void handleRemoveMobEffect(shared_ptr<RemoveMobEffectPacket> packet);
|
||||
virtual void handlePlayerInfo(shared_ptr<PlayerInfoPacket> packet);
|
||||
virtual void handleKeepAlive(shared_ptr<KeepAlivePacket> packet);
|
||||
virtual void handleSetExperience(shared_ptr<SetExperiencePacket> packet);
|
||||
virtual void handleSetCreativeModeSlot(shared_ptr<SetCreativeModeSlotPacket> packet);
|
||||
virtual void handleAddExperienceOrb(shared_ptr<AddExperienceOrbPacket> packet);
|
||||
|
||||
// 1.0.1
|
||||
virtual void handleContainerButtonClick(shared_ptr<ContainerButtonClickPacket> packet);
|
||||
|
||||
@@ -96,9 +96,6 @@ void Player::_init()
|
||||
m_uiDebugOptions=0L;
|
||||
|
||||
jumpTriggerTime = 0;
|
||||
takeXpDelay = 0;
|
||||
experienceLevel = totalExperience = 0;
|
||||
experienceProgress = 0.0f;
|
||||
|
||||
useItem = nullptr;
|
||||
useItemDuration = 0;
|
||||
@@ -1219,10 +1216,6 @@ void Player::readAdditionalSaveData(CompoundTag *entityTag)
|
||||
m_isSleeping = entityTag->getBoolean(L"Sleeping");
|
||||
sleepCounter = entityTag->getShort(L"SleepTimer");
|
||||
|
||||
experienceProgress = entityTag->getFloat(L"XpP");
|
||||
experienceLevel = entityTag->getInt(L"XpLevel");
|
||||
totalExperience = entityTag->getInt(L"XpTotal");
|
||||
|
||||
if (m_isSleeping)
|
||||
{
|
||||
bedPosition = new Pos( Mth::floor(x), Mth::floor(y), Mth::floor(z));
|
||||
@@ -1255,10 +1248,6 @@ void Player::addAdditonalSaveData(CompoundTag *entityTag)
|
||||
entityTag->putBoolean(L"Sleeping", m_isSleeping);
|
||||
entityTag->putShort(L"SleepTimer", (short) sleepCounter);
|
||||
|
||||
entityTag->putFloat(L"XpP", experienceProgress);
|
||||
entityTag->putInt(L"XpLevel", experienceLevel);
|
||||
entityTag->putInt(L"XpTotal", totalExperience);
|
||||
|
||||
if (respawnPosition != NULL)
|
||||
{
|
||||
entityTag->putInt(L"SpawnX", respawnPosition->x);
|
||||
@@ -2309,53 +2298,6 @@ void Player::handleInsidePortal()
|
||||
isInsidePortal = true;
|
||||
}
|
||||
|
||||
void Player::increaseXp(int i)
|
||||
{
|
||||
// Update xp calculations from 1.3
|
||||
score += i;
|
||||
int max = INT_MAX - totalExperience;
|
||||
if (i > max)
|
||||
{
|
||||
i = max;
|
||||
}
|
||||
experienceProgress += (float) i / getXpNeededForNextLevel();
|
||||
totalExperience += i;
|
||||
while (experienceProgress >= 1)
|
||||
{
|
||||
experienceProgress = (experienceProgress - 1) * getXpNeededForNextLevel();
|
||||
levelUp();
|
||||
experienceProgress /= getXpNeededForNextLevel();
|
||||
}
|
||||
}
|
||||
|
||||
void Player::withdrawExperienceLevels(int amount)
|
||||
{
|
||||
experienceLevel -= amount;
|
||||
if (experienceLevel < 0)
|
||||
{
|
||||
experienceLevel = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int Player::getXpNeededForNextLevel()
|
||||
{
|
||||
// Update xp calculations from 1.3
|
||||
if (experienceLevel >= 30)
|
||||
{
|
||||
return 17 + 15 * 3 + (experienceLevel - 30) * 7;
|
||||
}
|
||||
if (experienceLevel >= 15)
|
||||
{
|
||||
return 17 + (experienceLevel - 15) * 3;
|
||||
}
|
||||
return 17;
|
||||
}
|
||||
|
||||
void Player::levelUp()
|
||||
{
|
||||
experienceLevel++;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method adds on to the player's exhaustion, which may decrease the
|
||||
* player's food level.
|
||||
@@ -2419,22 +2361,6 @@ bool Player::mayBuild(int x, int y, int z)
|
||||
return abilities.mayBuild;
|
||||
}
|
||||
|
||||
int Player::getExperienceReward(shared_ptr<Player> killedBy)
|
||||
{
|
||||
int reward = experienceLevel * 7;
|
||||
if (reward > 100)
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
return reward;
|
||||
}
|
||||
|
||||
bool Player::isAlwaysExperienceDropper()
|
||||
{
|
||||
// players always drop experience
|
||||
return true;
|
||||
}
|
||||
|
||||
wstring Player::getAName()
|
||||
{
|
||||
return name;
|
||||
@@ -2453,10 +2379,6 @@ void Player::restoreFrom(shared_ptr<Player> oldPlayer, bool restoreAll)
|
||||
health = oldPlayer->health;
|
||||
foodData = oldPlayer->foodData;
|
||||
|
||||
experienceLevel = oldPlayer->experienceLevel;
|
||||
totalExperience = oldPlayer->totalExperience;
|
||||
experienceProgress = oldPlayer->experienceProgress;
|
||||
|
||||
score = oldPlayer->score;
|
||||
|
||||
for(AUTO_VAR(it, oldPlayer->activeEffects.begin()); it != oldPlayer->activeEffects.end(); ++it)
|
||||
|
||||
@@ -119,9 +119,6 @@ public:
|
||||
|
||||
Abilities abilities;
|
||||
|
||||
int experienceLevel, totalExperience;
|
||||
float experienceProgress;
|
||||
|
||||
// 4J Stu - Made protected so that we can access it from MultiPlayerLocalPlayer
|
||||
protected:
|
||||
shared_ptr<ItemInstance> useItem;
|
||||
@@ -341,10 +338,6 @@ public:
|
||||
virtual shared_ptr<ItemInstance> getArmor(int pos);
|
||||
virtual void handleInsidePortal();
|
||||
|
||||
void increaseXp(int i);
|
||||
virtual void withdrawExperienceLevels(int amount);
|
||||
int getXpNeededForNextLevel();
|
||||
|
||||
private:
|
||||
void levelUp();
|
||||
|
||||
@@ -356,10 +349,6 @@ public:
|
||||
virtual void startUsingItem(shared_ptr<ItemInstance> instance, int duration);
|
||||
bool mayBuild(int x, int y, int z);
|
||||
|
||||
protected:
|
||||
virtual int getExperienceReward(shared_ptr<Player> killedBy);
|
||||
virtual bool isAlwaysExperienceDropper();
|
||||
|
||||
public:
|
||||
virtual wstring getAName();
|
||||
|
||||
|
||||
@@ -78,13 +78,6 @@ int RedStoneOreTile::getResourceCount(Random *random)
|
||||
void RedStoneOreTile::spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel)
|
||||
{
|
||||
Tile::spawnResources(level, x, y, z, data, odds, playerBonusLevel);
|
||||
|
||||
// also spawn experience if the block is broken
|
||||
if (getResource(data, level->random, playerBonusLevel) != id)
|
||||
{
|
||||
int magicCount = 1 + level->random->nextInt(5);
|
||||
popExperience(level, x, y, z, magicCount);
|
||||
}
|
||||
}
|
||||
|
||||
void RedStoneOreTile::animateTick(Level *level, int x, int y, int z, Random *random)
|
||||
|
||||
@@ -20,12 +20,11 @@ bool RepairResultSlot::mayPlace(shared_ptr<ItemInstance> item)
|
||||
|
||||
bool RepairResultSlot::mayPickup(shared_ptr<Player> player)
|
||||
{
|
||||
return (player->abilities.instabuild || player->experienceLevel >= m_menu->cost) && (m_menu->cost > 0 && hasItem());
|
||||
return (player->abilities.instabuild) && (m_menu->cost > 0 && hasItem());
|
||||
}
|
||||
|
||||
void RepairResultSlot::onTake(shared_ptr<Player> player, shared_ptr<ItemInstance> carried)
|
||||
{
|
||||
if (!player->abilities.instabuild) player->withdrawExperienceLevels(m_menu->cost);
|
||||
m_menu->repairSlots->setItem(RepairMenu::INPUT_SLOT, nullptr);
|
||||
if (m_menu->repairItemCountCost > 0)
|
||||
{
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "SetExperiencePacket.h"
|
||||
#include "PacketListener.h"
|
||||
#include "InputOutputStream.h"
|
||||
|
||||
|
||||
|
||||
SetExperiencePacket::SetExperiencePacket()
|
||||
{
|
||||
this->experienceProgress = 0;
|
||||
this->totalExperience = 0;
|
||||
this->experienceLevel = 0;
|
||||
}
|
||||
|
||||
SetExperiencePacket::SetExperiencePacket(float experienceProgress, int totalExperience, int experienceLevel)
|
||||
{
|
||||
this->experienceProgress = experienceProgress;
|
||||
this->totalExperience = totalExperience;
|
||||
this->experienceLevel = experienceLevel;
|
||||
}
|
||||
|
||||
void SetExperiencePacket::read(DataInputStream *dis)
|
||||
{
|
||||
experienceProgress = dis->readFloat();
|
||||
experienceLevel = dis->readShort();
|
||||
totalExperience = dis->readShort();
|
||||
}
|
||||
|
||||
void SetExperiencePacket::write(DataOutputStream *dos)
|
||||
{
|
||||
dos->writeFloat(experienceProgress);
|
||||
dos->writeShort(experienceLevel);
|
||||
dos->writeShort(totalExperience);
|
||||
}
|
||||
|
||||
void SetExperiencePacket::handle(PacketListener *listener)
|
||||
{
|
||||
listener->handleSetExperience(shared_from_this());
|
||||
}
|
||||
|
||||
int SetExperiencePacket::getEstimatedSize()
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
bool SetExperiencePacket::canBeInvalidated()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SetExperiencePacket::isInvalidatedBy(shared_ptr<Packet> packet)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SetExperiencePacket::isAync()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Packet.h"
|
||||
|
||||
class SetExperiencePacket : public Packet, public enable_shared_from_this<SetExperiencePacket>
|
||||
{
|
||||
public:
|
||||
float experienceProgress;
|
||||
int totalExperience;
|
||||
int experienceLevel;
|
||||
|
||||
SetExperiencePacket();
|
||||
SetExperiencePacket(float experienceProgress, int totalExperience, int experienceLevel);
|
||||
|
||||
virtual void read(DataInputStream *dis);
|
||||
virtual void write(DataOutputStream *dos);
|
||||
virtual void handle(PacketListener *listener);
|
||||
virtual int getEstimatedSize();
|
||||
virtual bool canBeInvalidated();
|
||||
virtual bool isInvalidatedBy(shared_ptr<Packet> packet);
|
||||
virtual bool isAync();
|
||||
|
||||
public:
|
||||
static shared_ptr<Packet> create() { return shared_ptr<Packet>(new SetExperiencePacket()); }
|
||||
virtual int getId() { return 43; }
|
||||
};
|
||||
@@ -1,55 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "net.minecraft.world.entity.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.level.tile.h"
|
||||
#include "JavaMath.h"
|
||||
#include "ThrownExpBottle.h"
|
||||
|
||||
|
||||
|
||||
ThrownExpBottle::ThrownExpBottle(Level *level) : Throwable(level)
|
||||
{
|
||||
}
|
||||
|
||||
ThrownExpBottle::ThrownExpBottle(Level *level, shared_ptr<Mob> mob) : Throwable(level,mob)
|
||||
{
|
||||
}
|
||||
|
||||
ThrownExpBottle::ThrownExpBottle(Level *level, double x, double y, double z) : Throwable(level, x, y, z)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
float ThrownExpBottle::getGravity()
|
||||
{
|
||||
return 0.07f;
|
||||
}
|
||||
|
||||
float ThrownExpBottle::getThrowPower()
|
||||
{
|
||||
return 0.7f;
|
||||
}
|
||||
|
||||
float ThrownExpBottle::getThrowUpAngleOffset()
|
||||
{
|
||||
return -20;
|
||||
}
|
||||
|
||||
void ThrownExpBottle::onHit(HitResult *res)
|
||||
{
|
||||
|
||||
if (!level->isClientSide)
|
||||
{
|
||||
level->levelEvent(LevelEvent::PARTICLES_POTION_SPLASH, (int) Math::round(x), (int) Math::round(y), (int) Math::round(z), 0);
|
||||
|
||||
int xpCount = 3 + level->random->nextInt(5) + level->random->nextInt(5);
|
||||
while (xpCount > 0)
|
||||
{
|
||||
int newCount = ExperienceOrb::getExperienceValue(xpCount);
|
||||
xpCount -= newCount;
|
||||
level->addEntity(shared_ptr<ExperienceOrb>( new ExperienceOrb(level, x, y, z, newCount) ) );
|
||||
}
|
||||
|
||||
remove();
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Throwable.h"
|
||||
|
||||
class HitResult;
|
||||
|
||||
class ThrownExpBottle : public Throwable
|
||||
{
|
||||
public:
|
||||
eINSTANCEOF GetType() { return eTYPE_THROWNEXPBOTTLE; }
|
||||
static Entity *create(Level *level) { return new ThrownExpBottle(level); }
|
||||
public:
|
||||
ThrownExpBottle(Level *level);
|
||||
ThrownExpBottle(Level *level, shared_ptr<Mob> mob);
|
||||
ThrownExpBottle(Level *level, double x, double y, double z);
|
||||
|
||||
protected:
|
||||
virtual float getGravity();
|
||||
virtual float getThrowPower();
|
||||
virtual float getThrowUpAngleOffset();
|
||||
virtual void onHit(HitResult *res);
|
||||
};
|
||||
@@ -910,20 +910,6 @@ void Tile::popResource(Level *level, int x, int y, int z, shared_ptr<ItemInstanc
|
||||
level->addEntity(item);
|
||||
}
|
||||
|
||||
// Brought forward for TU7
|
||||
void Tile::popExperience(Level *level, int x, int y, int z, int amount)
|
||||
{
|
||||
if (!level->isClientSide)
|
||||
{
|
||||
while (amount > 0)
|
||||
{
|
||||
int newCount = ExperienceOrb::getExperienceValue(amount);
|
||||
amount -= newCount;
|
||||
level->addEntity(shared_ptr<ExperienceOrb>( new ExperienceOrb(level, x + .5, y + .5, z + .5, newCount)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int Tile::getSpawnResourcesAuxValue(int data)
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -565,7 +565,6 @@ public:
|
||||
virtual void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel);
|
||||
protected:
|
||||
virtual void popResource(Level *level, int x, int y, int z, shared_ptr<ItemInstance> itemInstance);
|
||||
virtual void popExperience(Level *level, int x, int y, int z, int amount);
|
||||
|
||||
public:
|
||||
virtual int getSpawnResourcesAuxValue(int data);
|
||||
|
||||
@@ -501,7 +501,6 @@ void Villager::addOffers(int addCount)
|
||||
break;
|
||||
case PROFESSION_PRIEST:
|
||||
addItemForPurchase(newOffers, Item::eyeOfEnder_Id, random, getRecipeChance(.3f));
|
||||
addItemForPurchase(newOffers, Item::expBottle_Id, random, getRecipeChance(.2f));
|
||||
addItemForPurchase(newOffers, Item::redStone_Id, random, getRecipeChance(.4f));
|
||||
addItemForPurchase(newOffers, Tile::lightGem_Id, random, getRecipeChance(.3f));
|
||||
{
|
||||
@@ -608,7 +607,6 @@ void Villager::staticCtor()
|
||||
MIN_MAX_PRICES[Item::helmet_cloth_Id] = pair<int,int>(2, 4);
|
||||
MIN_MAX_PRICES[Item::leggings_cloth_Id] = pair<int,int>(2, 4);
|
||||
MIN_MAX_PRICES[Item::saddle_Id] = pair<int,int>(6, 8);
|
||||
MIN_MAX_PRICES[Item::expBottle_Id] = pair<int,int>(-4, -1);
|
||||
MIN_MAX_PRICES[Item::redStone_Id] = pair<int,int>(-4, -1);
|
||||
MIN_MAX_PRICES[Item::compass_Id] = pair<int,int>(10, 12);
|
||||
MIN_MAX_PRICES[Item::clock_Id] = pair<int,int>(10, 12);
|
||||
|
||||
@@ -34,9 +34,4 @@ int WaterAnimal::getAmbientSoundInterval()
|
||||
bool WaterAnimal::removeWhenFarAway()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int WaterAnimal::getExperienceReward(shared_ptr<Player> killedBy)
|
||||
{
|
||||
return 1 + level->random->nextInt(3);
|
||||
}
|
||||
@@ -14,5 +14,4 @@ public:
|
||||
|
||||
protected:
|
||||
virtual bool removeWhenFarAway();
|
||||
virtual int getExperienceReward(shared_ptr<Player> killedBy);
|
||||
};
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "DefaultGameModeCommand.h"
|
||||
#include "EnchantItemCommand.h"
|
||||
#include "ExperienceCommand.h"
|
||||
#include "GameModeCommand.h"
|
||||
#include "GiveItemCommand.h"
|
||||
#include "KillCommand.h"
|
||||
|
||||
@@ -56,12 +56,10 @@
|
||||
#include "UseItemPacket.h"
|
||||
|
||||
// 1.8.2 Added
|
||||
#include "AddExperienceOrbPacket.h"
|
||||
#include "GetInfoPacket.h"
|
||||
#include "PlayerInfoPacket.h"
|
||||
#include "RemoveMobEffectPacket.h"
|
||||
#include "SetCreativeModeSlotPacket.h"
|
||||
#include "SetExperiencePacket.h"
|
||||
#include "UpdateMobEffectPacket.h"
|
||||
|
||||
// 1.0.1 Added
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
// 1.8.2
|
||||
#include "DelayedRelease.h"
|
||||
#include "ExperienceOrb.h"
|
||||
|
||||
// 1.0.1
|
||||
#include "MobType.h"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "Throwable.h"
|
||||
#include "ThrownEnderpearl.h"
|
||||
#include "ThrownPotion.h"
|
||||
#include "ThrownExpBottle.h" // Brought forward from 1.2
|
||||
|
||||
// Added TU 9
|
||||
#include "DragonFireball.h"
|
||||
@@ -56,7 +56,6 @@
|
||||
#include "PotionItem.h"
|
||||
#include "Rarity.h"
|
||||
#include "WaterLilyTileItem.h"
|
||||
#include "ExperienceItem.h" // 4J Stu brought forward
|
||||
#include "SmoothStoneBrickTileItem.h" // 4J Stu brought forward
|
||||
|
||||
// TU9
|
||||
|
||||
Reference in new issue
Block a user